@zydon/common 1.3.94 → 1.3.96

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
1
  import { ListingRulesProps } from '../../Filters/ListingRules/props';
2
- declare const ListingRules: ({ rules }: ListingRulesProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const ListingRules: ({ rules, setRuleType }: ListingRulesProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default ListingRules;
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Filters/ListingRules/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAQ1E,QAAA,MAAM,YAAY,cAAe,iBAAiB,4CAkEjD,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Filters/ListingRules/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAQ1E,QAAA,MAAM,YAAY,2BAA4B,iBAAiB,4CAoE9D,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  export interface ListingRulesProps {
3
+ setRuleType?(ruleType: string): void;
3
4
  rules?: {
4
5
  value: string;
5
6
  component: ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../../src/components/Filters/ListingRules/props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE;QACN,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,SAAS,CAAC;QACrB,WAAW,EAAE,MAAM,CAAC;KACrB,EAAE,CAAC;CACL"}
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../../src/components/Filters/ListingRules/props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,WAAW,iBAAiB;IAChC,WAAW,CAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,KAAK,CAAC,EAAE;QACN,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,SAAS,CAAC;QACrB,WAAW,EAAE,MAAM,CAAC;KACrB,EAAE,CAAC;CAEL"}
@@ -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-48c32aae.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-b3a209cf.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";
@@ -7751,7 +7751,7 @@ const zf2 = ({
7751
7751
  ...a,
7752
7752
  children: n
7753
7753
  }
7754
- ), i1a = () => import("./features-216fa195.js").then((e) => e.default), _Fn = ({ children: e }) => /* @__PURE__ */ O.jsx(yaa, { strict: !0, features: i1a, children: /* @__PURE__ */ O.jsxs(fr.div, { style: { height: "100%" }, children: [
7754
+ ), i1a = () => import("./features-0f44879a.js").then((e) => e.default), _Fn = ({ children: e }) => /* @__PURE__ */ O.jsx(yaa, { strict: !0, features: i1a, children: /* @__PURE__ */ O.jsxs(fr.div, { style: { height: "100%" }, children: [
7755
7755
  " ",
7756
7756
  e,
7757
7757
  " "
@@ -278985,15 +278985,17 @@ const TUn = ({ fileRejections: e }) => e.length ? /* @__PURE__ */ O.jsx(
278985
278985
  })), ds2 = Qt(ZRn)(() => ({
278986
278986
  display: "flex",
278987
278987
  justifyContent: "space-between"
278988
- })), K02 = ({ rules: e }) => {
278989
- const [t, n] = Ne(), { setValue: a } = kt();
278988
+ })), K02 = ({ rules: e, setRuleType: t }) => {
278989
+ const [n, a] = Ne(), { setValue: r } = kt();
278990
278990
  _t(() => {
278991
- e && e.length > 0 && n(e[0].value);
278991
+ if (e && e.length > 0 && (a(e[0].value), t))
278992
+ return t(e[0].value);
278992
278993
  }, []), _t(() => () => {
278993
- a("config", {});
278994
+ r("config", {});
278994
278995
  }, []);
278995
- const r = (u, c) => {
278996
- c !== null && n(c);
278996
+ const u = (c, s) => {
278997
+ if (s !== null && (a(s), t))
278998
+ return t(s);
278997
278999
  };
278998
279000
  return /* @__PURE__ */ O.jsxs(ae, { gap: 2, children: [
278999
279001
  /* @__PURE__ */ O.jsx(
@@ -279012,24 +279014,24 @@ const TUn = ({ fileRejections: e }) => e.length ? /* @__PURE__ */ O.jsx(
279012
279014
  ds2,
279013
279015
  {
279014
279016
  color: "primary",
279015
- value: t,
279017
+ value: n,
279016
279018
  size: "small",
279017
279019
  exclusive: !0,
279018
- onChange: r,
279019
- children: e.map((u, c) => /* @__PURE__ */ O.jsx(
279020
+ onChange: u,
279021
+ children: e.map((c, s) => /* @__PURE__ */ O.jsx(
279020
279022
  fs2,
279021
279023
  {
279022
- value: u.value,
279024
+ value: c.value,
279023
279025
  size: "small",
279024
279026
  color: "primary",
279025
- children: /* @__PURE__ */ O.jsx(Pe, { variant: "body2", children: u.toggleTitle })
279027
+ children: /* @__PURE__ */ O.jsx(Pe, { variant: "body2", children: c.toggleTitle })
279026
279028
  },
279027
- c
279029
+ s
279028
279030
  ))
279029
279031
  }
279030
279032
  ),
279031
279033
  e && e.map(
279032
- (u, c) => u.value === t ? /* @__PURE__ */ O.jsx("div", { children: u.component }, c) : null
279034
+ (c, s) => c.value === n ? /* @__PURE__ */ O.jsx("div", { children: c.component }, s) : null
279033
279035
  )
279034
279036
  ] });
279035
279037
  }, gs2 = Oe(ZRn)(
@@ -298062,7 +298064,7 @@ const g42 = ({
298062
298064
  }
298063
298065
  ),
298064
298066
  /* @__PURE__ */ O.jsxs(ae, { children: [
298065
- /* @__PURE__ */ O.jsx(Pe, { variant: "subtitle2", color: "text.primary", children: `${s} cadastrados` }),
298067
+ /* @__PURE__ */ O.jsx(Pe, { variant: "subtitle2", color: "text.primary", children: `${s} cadastrados(as)` }),
298066
298068
  /* @__PURE__ */ O.jsx(Pe, { variant: "caption", color: "text.disabled", children: `${p.length}/${h.length} selecionados` })
298067
298069
  ] })
298068
298070
  ] }),
@@ -298139,7 +298141,7 @@ const g42 = ({
298139
298141
  }
298140
298142
  ),
298141
298143
  /* @__PURE__ */ O.jsxs(ae, { children: [
298142
- /* @__PURE__ */ O.jsx(Pe, { variant: "subtitle2", color: "text.primary", children: `${l} selecionados` }),
298144
+ /* @__PURE__ */ O.jsx(Pe, { variant: "subtitle2", color: "text.primary", children: `${l} selecionados(as)` }),
298143
298145
  /* @__PURE__ */ O.jsx(Pe, { variant: "caption", color: "text.disabled", children: `${M.length}/${y.length} selecionados` })
298144
298146
  ] })
298145
298147
  ] }),
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ad as u, b8 as p, b4 as d, ae as m, af as C, ba as v, b9 as S, ag as T, ah as g, b_ as A, c2 as k, c1 as P, c0 as F, bb as I, bd as h, be as y, ai as B, aj as D, ak as x, al as M, am as R, an as w, ao as f, bf as E, bg as L, bh as N, ap as U, bv as G, aq as W, ar as H, as as O, at as q, b5 as z, bx as V, bi as j, b1 as K, au as Q, bj as Z, a$ as J, av as X, aw as Y, by as _, ax as $, a9 as aa, ay as sa, az as ea, bk as oa, aA as ta, ab as ra, b3 as ia, aB as ba, b2 as na, aC as la, bl as ca, bT as ua, aD as pa, aE as da, aF as ma, bA as Ca, bB as va, bz as Sa, bc as Ta, bm as ga, aa as Aa, aG as ka, bn as Pa, bo as Fa, aH as Ia, aZ as ha, aI as ya, bp as Ba, aJ as Da, aK as xa, aL as Ma, aM as Ra, b0 as wa, bU as fa, bV as Ea, aN as La, aO as Na, aP as Ua, aQ as Ga, a_ as Wa, bu as Ha, bq as Oa, bC as qa, aR as za, c6 as Va, c7 as ja, c4 as Ka, c9 as Qa, c8 as Za, c5 as Ja, bw as Xa, aS as Ya, aT as _a, br as $a, b6 as as, bW as ss, aU as es, aV as os, bs as ts, aW as rs, a8 as is, aX as bs, bt as ns, b7 as ls, aY as cs, bX as us, cz as ps, cA as ds, ct as ms, ca as Cs, bY as vs, cq as Ss, cr as Ts, cs as gs, cC as As, cb as ks, cD as Ps, cy as Fs, cx as Is, cu as hs, cv as ys, cc as Bs, cp as Ds, b$ as xs, cd as Ms, ce as Rs, cf as ws, cg as fs, ch as Es, ac as Ls, cn as Ns, cm as Us, cl as Gs, co as Ws, ci as Hs, bZ as Os, c3 as qs, cj as zs, ck as Vs, cB as js, cw as Ks, bQ as Qs, bR as Zs, bS as Js, bJ as Xs, bM as Ys, bE as _s, bG as $s, bL as ae, bD as se, bK as ee, bI as oe, bH as te, bO as re, bP as ie, bN as be, bF as ne } from "./index-48c32aae.js";
1
+ import { ad as u, b8 as p, b4 as d, ae as m, af as C, ba as v, b9 as S, ag as T, ah as g, b_ as A, c2 as k, c1 as P, c0 as F, bb as I, bd as h, be as y, ai as B, aj as D, ak as x, al as M, am as R, an as w, ao as f, bf as E, bg as L, bh as N, ap as U, bv as G, aq as W, ar as H, as as O, at as q, b5 as z, bx as V, bi as j, b1 as K, au as Q, bj as Z, a$ as J, av as X, aw as Y, by as _, ax as $, a9 as aa, ay as sa, az as ea, bk as oa, aA as ta, ab as ra, b3 as ia, aB as ba, b2 as na, aC as la, bl as ca, bT as ua, aD as pa, aE as da, aF as ma, bA as Ca, bB as va, bz as Sa, bc as Ta, bm as ga, aa as Aa, aG as ka, bn as Pa, bo as Fa, aH as Ia, aZ as ha, aI as ya, bp as Ba, aJ as Da, aK as xa, aL as Ma, aM as Ra, b0 as wa, bU as fa, bV as Ea, aN as La, aO as Na, aP as Ua, aQ as Ga, a_ as Wa, bu as Ha, bq as Oa, bC as qa, aR as za, c6 as Va, c7 as ja, c4 as Ka, c9 as Qa, c8 as Za, c5 as Ja, bw as Xa, aS as Ya, aT as _a, br as $a, b6 as as, bW as ss, aU as es, aV as os, bs as ts, aW as rs, a8 as is, aX as bs, bt as ns, b7 as ls, aY as cs, bX as us, cz as ps, cA as ds, ct as ms, ca as Cs, bY as vs, cq as Ss, cr as Ts, cs as gs, cC as As, cb as ks, cD as Ps, cy as Fs, cx as Is, cu as hs, cv as ys, cc as Bs, cp as Ds, b$ as xs, cd as Ms, ce as Rs, cf as ws, cg as fs, ch as Es, ac as Ls, cn as Ns, cm as Us, cl as Gs, co as Ws, ci as Hs, bZ as Os, c3 as qs, cj as zs, ck as Vs, cB as js, cw as Ks, bQ as Qs, bR as Zs, bS as Js, bJ as Xs, bM as Ys, bE as _s, bG as $s, bL as ae, bD as se, bK as ee, bI as oe, bH as te, bO as re, bP as ie, bN as be, bF as ne } from "./index-b3a209cf.js";
2
2
  import "react";
3
3
  import "@mui/material";
4
4
  import "@emotion/react";
@@ -35406,7 +35406,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
35406
35406
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bcu(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ycu(e){if(Array.isArray(e))return mWn(e)}function VKn(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 FKn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VKn(Object(n),!0).forEach(function(a){NKn(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VKn(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function NKn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Evt(e,t){return jcu(e)||Ocu(e,t)||TKn(e,t)||pcu()}function pcu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
35407
35407
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function TKn(e,t){if(e){if(typeof e=="string")return mWn(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 mWn(e,t)}}function mWn(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 Ocu(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,s;try{for(n=n.call(e);!(r=(c=n.next()).done)&&(a.push(c.value),!(t&&a.length===t));r=!0);}catch(l){u=!0,s=l}finally{try{!r&&n.return!=null&&n.return()}finally{if(u)throw s}}return a}}function jcu(e){if(Array.isArray(e))return e}var wcu="file-invalid-type",Mcu="file-too-large",Lcu="file-too-small",Pcu="too-many-files",Ecu=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:wcu,message:"File type must be ".concat(n)}},ZKn=function(t){return{code:Mcu,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},UKn=function(t){return{code:Lcu,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},kcu={code:Pcu,message:"Too many files"};function GKn(e,t){var n=e.type==="application/x-moz-file"||hcu(e,t);return[n,n?null:Ecu(t)]}function KKn(e,t,n){if(nZ(e.size))if(nZ(t)&&nZ(n)){if(e.size>n)return[!1,ZKn(n)];if(e.size<t)return[!1,UKn(t)]}else{if(nZ(t)&&e.size<t)return[!1,UKn(t)];if(nZ(n)&&e.size>n)return[!1,ZKn(n)]}return[!0,null]}function nZ(e){return e!=null}function Scu(e){var t=e.files,n=e.accept,a=e.minSize,r=e.maxSize,u=e.multiple,c=e.maxFiles,s=e.validator;return!u&&t.length>1||u&&c>=1&&t.length>c?!1:t.every(function(l){var d=GKn(l,n),f=Evt(d,1),g=f[0],_=KKn(l,a,r),m=Evt(_,1),v=m[0],h=s?s(l):null;return g&&v&&!h})}function Tbt(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Zbt(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 YKn(e){e.preventDefault()}function Dcu(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function Icu(e){return e.indexOf("Edge/")!==-1}function Bcu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return Dcu(e)||Icu(e)}function il(){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(s){return!Tbt(a)&&s&&s.apply(void 0,[a].concat(u)),Tbt(a)})}}function Wcu(){return"showOpenFilePicker"in window}function $cu(e){if(nZ(e)){var t=Object.entries(e).filter(function(n){var a=Evt(n,2),r=a[0],u=a[1],c=!0;return XKn(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(QKn))&&(console.warn('Skipped "'.concat(r,'" because an invalid file extension was provided.')),c=!1),c}).reduce(function(n,a){var r=Evt(a,2),u=r[0],c=r[1];return FKn(FKn({},n),{},NKn({},u,c))},{});return[{description:"Files",accept:t}]}return e}function xcu(e){if(nZ(e))return Object.entries(e).reduce(function(t,n){var a=Evt(n,2),r=a[0],u=a[1];return[].concat(HKn(t),[r],HKn(u))},[]).filter(function(t){return XKn(t)||QKn(t)}).join(",")}function Acu(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function Rcu(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function XKn(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function QKn(e){return/^.*\.[\w]+$/.test(e)}var zcu=["children"],Hcu=["open"],Vcu=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],Fcu=["refKey","onChange","onClick"];function Ncu(e){return Ucu(e)||Zcu(e)||JKn(e)||Tcu()}function Tcu(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
35408
35408
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zcu(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ucu(e){if(Array.isArray(e))return hWn(e)}function vWn(e,t){return Ycu(e)||Kcu(e,t)||JKn(e,t)||Gcu()}function Gcu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
35409
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JKn(e,t){if(e){if(typeof e=="string")return hWn(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 hWn(e,t)}}function hWn(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 Kcu(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,s;try{for(n=n.call(e);!(r=(c=n.next()).done)&&(a.push(c.value),!(t&&a.length===t));r=!0);}catch(l){u=!0,s=l}finally{try{!r&&n.return!=null&&n.return()}finally{if(u)throw s}}return a}}function Ycu(e){if(Array.isArray(e))return e}function qKn(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 Xt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qKn(Object(n),!0).forEach(function(a){CWn(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qKn(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function CWn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ubt(e,t){if(e==null)return{};var n=Xcu(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 Xcu(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 bWn=o.forwardRef(function(e,t){var n=e.children,a=Ubt(e,zcu),r=Gbt(a),u=r.open,c=Ubt(r,Hcu);return o.useImperativeHandle(t,function(){return{open:u}},[u]),o.createElement(o.Fragment,null,n(Xt(Xt({},c),{},{open:u})))});bWn.displayName="Dropzone";var eYn={disabled:!1,getFilesFromEvent:ccu,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};bWn.defaultProps=eYn,bWn.propTypes={children:F.func,accept:F.objectOf(F.arrayOf(F.string)),multiple:F.bool,preventDropOnDocument:F.bool,noClick:F.bool,noKeyboard:F.bool,noDrag:F.bool,noDragEventsBubbling:F.bool,minSize:F.number,maxSize:F.number,maxFiles:F.number,disabled:F.bool,getFilesFromEvent:F.func,onFileDialogCancel:F.func,onFileDialogOpen:F.func,useFsAccessApi:F.bool,autoFocus:F.bool,onDragEnter:F.func,onDragLeave:F.func,onDragOver:F.func,onDrop:F.func,onDropAccepted:F.func,onDropRejected:F.func,onError:F.func,validator:F.func};var yWn={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Gbt(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Xt(Xt({},eYn),e),n=t.accept,a=t.disabled,r=t.getFilesFromEvent,u=t.maxSize,c=t.minSize,s=t.multiple,l=t.maxFiles,d=t.onDragEnter,f=t.onDragLeave,g=t.onDragOver,_=t.onDrop,m=t.onDropAccepted,v=t.onDropRejected,h=t.onFileDialogCancel,C=t.onFileDialogOpen,p=t.useFsAccessApi,y=t.autoFocus,S=t.preventDropOnDocument,w=t.noClick,j=t.noKeyboard,b=t.noDrag,M=t.noDragEventsBubbling,P=t.onError,k=t.validator,W=o.useMemo(function(){return xcu(n)},[n]),I=o.useMemo(function(){return $cu(n)},[n]),D=o.useMemo(function(){return typeof C=="function"?C:tYn},[C]),E=o.useMemo(function(){return typeof h=="function"?h:tYn},[h]),L=o.useRef(null),B=o.useRef(null),$=o.useReducer(Qcu,yWn),x=vWn($,2),R=x[0],H=x[1],z=R.isFocused,N=R.isFileDialogActive,K=o.useRef(typeof window<"u"&&window.isSecureContext&&p&&Wcu()),Z=function(){!K.current&&N&&setTimeout(function(){if(B.current){var Le=B.current.files;Le.length||(H({type:"closeDialog"}),E())}},300)};o.useEffect(function(){return window.addEventListener("focus",Z,!1),function(){window.removeEventListener("focus",Z,!1)}},[B,N,E,K]);var T=o.useRef([]),U=function(Le){L.current&&L.current.contains(Le.target)||(Le.preventDefault(),T.current=[])};o.useEffect(function(){return S&&(document.addEventListener("dragover",YKn,!1),document.addEventListener("drop",U,!1)),function(){S&&(document.removeEventListener("dragover",YKn),document.removeEventListener("drop",U))}},[L,S]),o.useEffect(function(){return!a&&y&&L.current&&L.current.focus(),function(){}},[L,y,a]);var Y=o.useCallback(function(me){P?P(me):console.error(me)},[P]),te=o.useCallback(function(me){me.preventDefault(),me.persist(),We(me),T.current=[].concat(Ncu(T.current),[me.target]),Zbt(me)&&Promise.resolve(r(me)).then(function(Le){if(!(Tbt(me)&&!M)){var ae=Le.length,le=ae>0&&Scu({files:Le,accept:W,minSize:c,maxSize:u,multiple:s,maxFiles:l,validator:k}),ye=ae>0&&!le;H({isDragAccept:le,isDragReject:ye,isDragActive:!0,type:"setDraggedFiles"}),d&&d(me)}}).catch(function(Le){return Y(Le)})},[r,d,Y,M,W,c,u,s,l,k]),re=o.useCallback(function(me){me.preventDefault(),me.persist(),We(me);var Le=Zbt(me);if(Le&&me.dataTransfer)try{me.dataTransfer.dropEffect="copy"}catch{}return Le&&g&&g(me),!1},[g,M]),q=o.useCallback(function(me){me.preventDefault(),me.persist(),We(me);var Le=T.current.filter(function(le){return L.current&&L.current.contains(le)}),ae=Le.indexOf(me.target);ae!==-1&&Le.splice(ae,1),T.current=Le,!(Le.length>0)&&(H({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Zbt(me)&&f&&f(me))},[L,f,M]),ie=o.useCallback(function(me,Le){var ae=[],le=[];me.forEach(function(ye){var ge=GKn(ye,W),Be=vWn(ge,2),Qe=Be[0],dt=Be[1],vt=KKn(ye,c,u),ut=vWn(vt,2),Ye=ut[0],$t=ut[1],kn=k?k(ye):null;if(Qe&&Ye&&!kn)ae.push(ye);else{var e1=[dt,$t];kn&&(e1=e1.concat(kn)),le.push({file:ye,errors:e1.filter(function(xn){return xn})})}}),(!s&&ae.length>1||s&&l>=1&&ae.length>l)&&(ae.forEach(function(ye){le.push({file:ye,errors:[kcu]})}),ae.splice(0)),H({acceptedFiles:ae,fileRejections:le,type:"setFiles"}),_&&_(ae,le,Le),le.length>0&&v&&v(le,Le),ae.length>0&&m&&m(ae,Le)},[H,s,W,c,u,l,_,m,v,k]),de=o.useCallback(function(me){me.preventDefault(),me.persist(),We(me),T.current=[],Zbt(me)&&Promise.resolve(r(me)).then(function(Le){Tbt(me)&&!M||ie(Le,me)}).catch(function(Le){return Y(Le)}),H({type:"reset"})},[r,ie,Y,M]),oe=o.useCallback(function(){if(K.current){H({type:"openDialog"}),D();var me={multiple:s,types:I};window.showOpenFilePicker(me).then(function(Le){return r(Le)}).then(function(Le){ie(Le,null),H({type:"closeDialog"})}).catch(function(Le){Acu(Le)?(E(Le),H({type:"closeDialog"})):Rcu(Le)?(K.current=!1,B.current?(B.current.value=null,B.current.click()):Y(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."))):Y(Le)});return}B.current&&(H({type:"openDialog"}),D(),B.current.value=null,B.current.click())},[H,D,E,p,ie,Y,I,s]),ze=o.useCallback(function(me){!L.current||!L.current.isEqualNode(me.target)||(me.key===" "||me.key==="Enter"||me.keyCode===32||me.keyCode===13)&&(me.preventDefault(),oe())},[L,oe]),_e=o.useCallback(function(){H({type:"focus"})},[]),ue=o.useCallback(function(){H({type:"blur"})},[]),he=o.useCallback(function(){w||(Bcu()?setTimeout(oe,0):oe())},[w,oe]),Me=function(Le){return a?null:Le},se=function(Le){return j?null:Me(Le)},Se=function(Le){return b?null:Me(Le)},We=function(Le){M&&Le.stopPropagation()},Ge=o.useMemo(function(){return function(){var me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Le=me.refKey,ae=Le===void 0?"ref":Le,le=me.role,ye=me.onKeyDown,ge=me.onFocus,Be=me.onBlur,Qe=me.onClick,dt=me.onDragEnter,vt=me.onDragOver,ut=me.onDragLeave,Ye=me.onDrop,$t=Ubt(me,Vcu);return Xt(Xt(CWn({onKeyDown:se(il(ye,ze)),onFocus:se(il(ge,_e)),onBlur:se(il(Be,ue)),onClick:Me(il(Qe,he)),onDragEnter:Se(il(dt,te)),onDragOver:Se(il(vt,re)),onDragLeave:Se(il(ut,q)),onDrop:Se(il(Ye,de)),role:typeof le=="string"&&le!==""?le:"presentation"},ae,L),!a&&!j?{tabIndex:0}:{}),$t)}},[L,ze,_e,ue,he,te,re,q,de,j,b,a]),Ze=o.useCallback(function(me){me.stopPropagation()},[]),It=o.useMemo(function(){return function(){var me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Le=me.refKey,ae=Le===void 0?"ref":Le,le=me.onChange,ye=me.onClick,ge=Ubt(me,Fcu),Be=CWn({accept:W,multiple:s,type:"file",style:{display:"none"},onChange:Me(il(le,de)),onClick:Me(il(ye,Ze)),tabIndex:-1},ae,B);return Xt(Xt({},Be),ge)}},[B,n,s,de,a]);return Xt(Xt({},R),{},{isFocused:z&&!a,getRootProps:Ge,getInputProps:It,rootRef:L,inputRef:B,open:Me(oe)})}function Qcu(e,t){switch(t.type){case"focus":return Xt(Xt({},e),{},{isFocused:!0});case"blur":return Xt(Xt({},e),{},{isFocused:!1});case"openDialog":return Xt(Xt({},yWn),{},{isFileDialogActive:!0});case"closeDialog":return Xt(Xt({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Xt(Xt({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Xt(Xt({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Xt({},yWn);default:return e}}function tYn(){}const nYn=({fileRejections:e})=>e.length?O.jsx(A.Paper,{variant:"outlined",sx:{py:1,px:2,mt:3,bgcolor:t=>ve(t.palette.error.main,.08),borderColor:t=>ve(t.palette.error.main,.24)},children:e.map(({file:t,errors:n})=>{const{path:a,size:r}=gWn(t);return O.jsxs(A.Box,{sx:{my:1},children:[O.jsxs(A.Typography,{variant:"subtitle2",noWrap:!0,children:[a," - ",r?eWn(r):""]}),n.map(u=>O.jsxs(A.Box,{component:"span",sx:{typography:"caption"},children:["- ",u.message]},u.code))]},a)})}):null,Jcu=({file:e})=>{if(!e)return null;const t=typeof e=="string"?e:e.preview;return O.jsx(A.Stack,{position:"absolute",width:1,height:1,maxHeight:"100%",alignItems:"center",justifyContent:"center",top:0,right:0,bottom:0,left:0,padding:2,margin:"auto",children:O.jsx("img",{alt:"file preview",src:t,style:{borderRadius:8,width:"auto",maxWidth:"100%",maxHeight:"100%",height:"auto"}})})},qcu=zt("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 ${ve(e.palette.grey[500],.32)}`,"&:hover":{opacity:.72}})),elu=({header:e,description:t,sx:n,...a})=>O.jsxs(A.Stack,{spacing:5,alignItems:"center",justifyContent:"center",direction:{xs:"column",md:"row"},sx:{width:1,textAlign:{xs:"center",md:"left"},...n},...a,children:[O.jsx(jxn,{sx:{width:220}}),O.jsxs("div",{children:[O.jsx(A.Typography,{gutterBottom:!0,variant:"h5",children:e||"Soltar ou selecionar arquivos"}),O.jsx(A.Typography,{variant:"body2",sx:{color:"text.secondary"},children:t||O.jsxs(O.Fragment,{children:["Solte os arquivos aqui ou clique",O.jsx(A.Typography,{variant:"body2",component:"span",sx:{mx:.5,color:"primary.main",textDecoration:"underline"},children:"procurar"}),"na sua máquina"]})})]})]}),rYn=({id:e,disabled:t,multiple:n=!1,error:a,helperText:r,file:u,onDelete:c,files:s,thumbnail:l,onRemove:d,onHandleMainImage:f,mainUrl:g,sx:_,dropZoneProps:m,placeholderProps:v,placeholderAlt:h,image:C,tabIndex:p,...y})=>{const{getRootProps:S,getInputProps:w,isDragActive:j,isDragReject:b,fileRejections:M}=Gbt({multiple:n,disabled:t,...y}),P=!!u&&!n||C,k=s&&n&&s.length>0,W=b||!!a;return O.jsxs(A.Box,{sx:{width:1,position:"relative",..._},children:[O.jsxs(qcu,{...S(),sx:{...j&&{opacity:.72},...W&&{color:"error.main",bgcolor:"error.lighter",borderColor:"error.light"},...t&&{opacity:.48,pointerEvents:"none"},...m},children:[O.jsx("input",{...w(),id:e,tabIndex:p}),h?O.jsx(A.Stack,{sx:{...P&&{opacity:0}},children:h}):O.jsx(elu,{sx:{...P&&{opacity:0}},header:v==null?void 0:v.title,description:v==null?void 0:v.description}),P&&O.jsx(Jcu,{file:u||C||""})]}),r&&O.jsx(A.FormHelperText,{error:!!a,sx:I=>({mx:"14px",color:t?I.palette.grey[500]:void 0}),children:r}),O.jsx(nYn,{fileRejections:M}),P&&c&&O.jsx(A.IconButton,{size:"small",onClick:c,sx:{top:16,right:16,zIndex:9,position:"absolute",color:I=>ve(I.palette.common.white,.8),bgcolor:I=>ve(I.palette.grey[900],.72),"&:hover":{bgcolor:I=>ve(I.palette.grey[900],.48)}},children:O.jsx(we,{icon:"CLOSE_MARK_BUTTON",width:18})}),k&&O.jsx(O.Fragment,{children:O.jsx(A.Box,{sx:{my:3},children:O.jsx(acu,{files:s,thumbnail:l,onRemove:d,onHandleMainImage:f,mainUrl:g})})})]})},tlu=({file:e})=>{if(!e)return null;const t=typeof e=="string"?e:e.preview;return O.jsx("img",{alt:"avatar",src:t,style:{zIndex:8,overflow:"hidden",borderRadius:"50%",position:"absolute",width:"calc(100% - 16px)",height:"calc(100% - 16px)"}})},nlu=zt("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 ${ve(e.palette.grey[500],.32)}`})),rlu=zt("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})})),aYn=({error:e,file:t,image:n,disabled:a,helperText:r,sx:u,tabIndex:c,...s})=>{const{getRootProps:l,getInputProps:d,isDragActive:f,isDragReject:g,fileRejections:_}=Gbt({multiple:!1,disabled:a,...s}),m=!!t||n,v=g||!!e;return O.jsxs(O.Fragment,{children:[O.jsxs(nlu,{...l(),sx:{...f&&{opacity:.72},...v&&{borderColor:"error.light",...m&&{bgcolor:"error.lighter"}},...a&&{opacity:.48,pointerEvents:"none"},...m&&{"&:hover":{"& .placeholder":{opacity:1}}},...u},children:[O.jsx("input",{...d(),tabIndex:c}),m&&O.jsx(tlu,{file:t||n||""}),O.jsxs(rlu,{className:"placeholder",sx:{"&:hover":{opacity:.72},...m&&{zIndex:9,opacity:0,color:"common.white",bgcolor:h=>ve(h.palette.grey[900],.64)},...v&&{color:"error.main",bgcolor:"error.lighter"}},children:[O.jsx(we,{icon:"ADD_IMAGE",width:24,sx:{mb:1}}),O.jsx(A.Typography,{variant:"caption",children:t?"Atualizar foto":"Carregar foto"})]})]}),r&&r,O.jsx(nYn,{fileRejections:_})]})},alu=zt("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:ve(e.palette.grey[500],.08),"&:hover":{opacity:.72}})),ilu=({placeholderAlt:e,error:t,disabled:n,sx:a,tabIndex:r,...u})=>{const{getRootProps:c,getInputProps:s,isDragActive:l,isDragReject:d}=Gbt({disabled:n,...u}),f=d||t;return O.jsxs(alu,{...c(),sx:{...l&&{opacity:.72},...f&&{color:"error.main",bgcolor:"error.lighter",borderColor:"error.light"},...n&&{opacity:.48,pointerEvents:"none"},...a},children:[O.jsx("input",{...s(),tabIndex:r}),e||O.jsx(we,{icon:"CLOUD_UPLOAD",width:28})]})},iYn=({onFileCropped:e,onImageUploaded:t,onCancel:n})=>{const a=o.useId(),[r,u]=o.useState(),[c,s,l]=xmt(),[d,f]=o.useState();return{id:a,setCropModalOpen:l,handleRemove:()=>{e(void 0),t(void 0),l(!1)},toggleCropModalOpen:s,cropModalOpen:c,cancelChanges:()=>{n&&n(),l(!1)},saveChanges:()=>{r!==void 0&&r.getCroppedCanvas().toBlob(C=>{if(!C)return;const p=new File([C],"imagem");e(p),s()},"image/png",1)},previewImage:()=>{r!==void 0&&f(r.getCroppedCanvas().toDataURL())},setCropper:u,preview:d,closePreviewImage:()=>f(void 0)}},oYn=({id:e,open:t,onClose:n,label:a,onSave:r,onRemove:u,onPreview:c,imageSrc:s,aspectRatio:l,onInitialized:d})=>{const[f,g]=o.useState(.5);return O.jsx(MKn,{open:t,onClose:n,dialogTitle:a,actions:O.jsxs(O.Fragment,{children:[O.jsx(A.Button,{variant:"outlined",size:"medium",onClick:n,color:"inherit",children:"Cancelar"}),O.jsx(A.Button,{variant:"contained",size:"medium",onClick:r,children:"Salvar"})]}),fullWidth:!0,maxWidth:"sm",keepMounted:!0,children:O.jsxs(A.Stack,{gap:2,children:[O.jsx(tKn,{imageSrc:s,aspectRatio:l,onInitialized:d,zoom:f,onZoomChange:g}),O.jsxs(A.Stack,{gap:1.5,children:[O.jsxs(A.Stack,{width:1,direction:"row",gap:3,flex:1,alignItems:"center",children:[O.jsx(A.Typography,{variant:"body1",children:"Zoom"}),O.jsx(A.Slider,{value:f,onChange:(_,m)=>g(Array.isArray(m)?m[0]:m),min:.1,max:2,size:"medium",step:.0125})]}),O.jsxs(A.Stack,{direction:"row",gap:2,children:[O.jsx(A.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:O.jsx(we,{icon:"DELETE_MARK_BUTTON_02"}),onClick:u,children:"Remover"}),O.jsx(A.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:O.jsx(we,{icon:"PLAY_SIMPLE"}),onClick:c,children:"Pré-visualizar"}),O.jsx(A.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:O.jsx(we,{icon:"SEARCH_IMAGE"}),component:"label",htmlFor:e,children:"Alterar"})]})]})]})})},olu=A.styled(A.Stack)({position:"relative",width:"100%",borderRadius:8,overflow:"hidden","&:hover .actions":{display:"flex"}}),ulu=A.styled(A.Stack)(({theme:e})=>({display:"none",position:"absolute",alignItems:"center",justifyContent:"center",flexDirection:"row",gap:12,width:"100%",height:"100%",backgroundColor:A.alpha(e.palette.primary.main,.9),zIndex:999,button:{"&, &:hover, &:focus":{backgroundColor:"#fff"}}})),clu=A.styled(A.CircularProgress)({position:"absolute",width:"100%",height:"100%",zIndex:99,backgroundColor:"#fff",borderRadius:"50%"}),uYn=({onFileCropped:e,onImageUploaded:t,onCancel:n,aspect:a,label:r,image:u="",uploading:c,file:s,tabIndex:l,...d})=>{const{id:f,setCropModalOpen:g,handleRemove:_,toggleCropModalOpen:m,cropModalOpen:v,cancelChanges:h,saveChanges:C,previewImage:p,setCropper:y,preview:S,closePreviewImage:w}=iYn({onFileCropped:e,onImageUploaded:t,onCancel:n});return O.jsxs(O.Fragment,{children:[O.jsxs(olu,{children:[c&&O.jsx(Obt,{}),O.jsx(rYn,{...d,id:f,file:s,onDrop:j=>{if(j.length>0){g(!0);const b=new FileReader;b.addEventListener("load",()=>{var P;const M=((P=b.result)==null?void 0:P.toString())||"";t(M),e(void 0)}),b.readAsDataURL(j[0])}},image:u,tabIndex:l}),(s||u)&&O.jsxs(ulu,{className:"actions",children:[O.jsx(A.Button,{color:"inherit",startIcon:O.jsx(we,{icon:"DELETE_MARK_BUTTON_02",color:"error.main"}),onClick:_,children:"Remover"}),O.jsx(A.Button,{color:"inherit",startIcon:O.jsx(we,{icon:"SEARCH_IMAGE",color:"primary.maon"}),onClick:m,children:"Editar"})]})]}),O.jsx(oYn,{id:f,open:v,onClose:h,label:r,aspectRatio:a,imageSrc:u,onRemove:_,onSave:C,onPreview:p,onInitialized:y}),O.jsx(A.Dialog,{open:!!S,onClose:w,scroll:"body",PaperProps:{sx:{p:2}},children:S&&O.jsx("img",{src:S,alt:"Preview"})})]})},llu=A.styled(A.Stack)(({theme:e})=>({backgroundColor:"#fff",border:`1px solid ${e.palette.grey[300]}`})),cYn=({children:e,...t})=>O.jsx(llu,{borderRadius:1,gap:3,padding:3,...t,children:e}),slu=A.styled(A.Box)(()=>({marginLeft:"4px",fontWeight:"fontWeightBold"})),flu=A.styled(A.Button)(()=>({fontWeight:"fontWeightSemiBold"})),dlu=A.styled(we)(({theme:e})=>({color:e.palette.primary.main})),glu=({selectedTitle:e,onSelect:t,options:n})=>{const a=Amt();return O.jsxs(O.Fragment,{children:[O.jsx(flu,{disableRipple:!0,color:"inherit",onClick:a.onOpen,endIcon:O.jsx(dlu,{icon:a.open?"CHEVRON_UP":"ARROW_DOWN_SIMPLE"}),children:O.jsx(slu,{component:"span",children:e.label})}),O.jsx(wKn,{open:a.open,onClose:a.onClose,children:n.map(r=>O.jsx(A.MenuItem,{selected:r.value===e.value,onClick:()=>{a.onClose(),t(r.value)},children:r.label},r.value))})]})},_lu=A.styled(A.Stack)({display:"grid",gridTemplateColumns:"auto auto"}),mlu=A.styled(A.Typography)(({theme:e})=>({color:e.palette.grey[600]})),vlu=A.styled(A.Typography)(({theme:e})=>({textAlign:"right",color:e.palette.grey[800]})),hlu=({data:e,...t})=>e.length===0?null:O.jsx(_lu,{gap:1,...t,children:e.map(n=>[O.jsx(mlu,{variant:"body2",children:n.label},`label:${n.id}`),O.jsx(vlu,{variant:"body2",children:n.value},`value:${n.id}`)])}),Clu=A.styled(A.Stack)(({theme:e})=>({backgroundColor:"#fff",minWidth:"250px",padding:24,minHeight:"100vh",borderRight:`1px solid ${e.palette.grey[300]}`})),blu=A.styled(A.Stack)(({theme:e})=>({backgroundColor:"#fff",position:"sticky",top:0,zIndex:999,width:"100%",padding:24,gap:24,borderBottom:`1px solid ${e.palette.grey[300]}`})),ylu=A.styled(A.Stack)({flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:24}),plu=A.styled(A.Stack)(({theme:e})=>({height:"100%",width:"50%",flex:1,[e.breakpoints.down(1680)]:{width:"70%"}})),Olu=A.styled(A.Typography)(({theme:e})=>({color:e.palette.grey[800],fontSize:18,fontWeight:700})),jlu=A.styled(A.Typography)(({theme:e})=>({color:e.palette.grey[500],fontSize:14,fontWeight:400,paddingBottom:24})),wlu=A.styled(A.Button)(({theme:e})=>({paddingTop:6,paddingBottom:6,paddingLeft:0,margin:0,marginBottom:4,marginTop:4,width:"100%",display:"block",cursor:"pointer",color:e.palette.grey[600],textAlign:"left",fontWeight:400,fontSize:14,"> span":{color:e.palette.error.main}})),Mlu=A.styled(ZT)(()=>({height:1,"& .simplebar-content":{height:1}})),Llu=A.styled(A.Stack)(()=>({position:"fixed",width:"202px"})),Plu=({title:e,sections:t,headerLeftContent:n,headerRightContent:a,onClickBack:r})=>O.jsx(A.Stack,{children:O.jsxs(A.Stack,{direction:"row",children:[O.jsx(Clu,{children:O.jsx(Mlu,{children:O.jsxs(Llu,{children:[O.jsx(A.Typography,{variant:"overline",color:"text.disabled",fontWeight:700,children:"ACESSO RÁPIDO"}),t.map((u,c)=>O.jsxs(A.Stack,{children:[O.jsxs(wlu,{onClick:()=>{u.ref.current&&u.ref.current.scrollIntoView({block:"end",behavior:"smooth"})},children:[u.title,u.isRequired&&O.jsx("span",{children:"*"})]}),c<t.length-1&&O.jsx(A.Divider,{})]},c))]})})}),O.jsxs(A.Stack,{width:"100%",alignItems:"center",mb:8,children:[O.jsx(blu,{children:O.jsxs(ylu,{children:[O.jsxs(A.Stack,{flexDirection:"row",gap:2,children:[O.jsx(A.IconButton,{color:"primary",onClick:()=>r(),children:O.jsx(we,{icon:"CHEVRON_LEFT"})}),O.jsx(A.Typography,{variant:"h4",children:e}),n]}),O.jsxs(A.Stack,{direction:"row",gap:2,alignItems:"center",minWidth:"max-content",children:[O.jsx(xDn,{disabled:!0}),a]})]})}),O.jsx(plu,{children:t.map(u=>O.jsxs(A.Stack,{ref:u.ref,paddingTop:3,paddingBottom:2,alignItems:"start",width:"100%",children:[O.jsx(Olu,{children:u.title}),O.jsx(jlu,{children:u.subTitle}),O.jsx(cYn,{width:"100%",borderRadius:1,gap:1.5,padding:3,children:u.child})]},u.title))})]})]})}),Elu=A.styled(A.Box)(({theme:e})=>({padding:24,borderRadius:8,height:"auto",maxWidth:800,backgroundColor:e.palette.background.default,border:`1px solid ${e.palette.grey[300]}`})),klu=A.styled(A.Stack)(({theme:e})=>({minHeight:180,maxWidth:700,border:`4px dotted ${e.palette.grey[300]}`,borderRadius:8,backgroundColor:"#fff",padding:24})),Slu=A.styled(A.Box)(()=>({maxWidth:70,maxHeight:40,alignItems:"center","&, img":{flex:1,display:"flex",objectFit:"cover",borderRadius:8}})),Dlu=A.styled(A.Box)(({theme:e})=>({backgroundColor:e.palette.background.default,maxWidth:90,maxHeight:80,alignItems:"center","&, img":{flex:1,display:"flex",objectFit:"cover",borderRadius:8}})),lYn=A.styled(A.Stack)(({theme:e})=>({border:`4px dotted ${e.palette.grey[300]}`,borderRadius:8,backgroundColor:"#fff"})),Ilu=A.styled(A.Box)(({theme:e})=>({width:"auto",height:120,overflow:"hidden",padding:2,borderBottom:`4px dotted ${e.palette.grey[300]}`})),Blu=({titlePreview:e,logoImage:t,brandingName:n,url:a,title:r,description:u,keyWords:c,customTitles:s,productImage:l,child:d,previewLinkImage:f,hasPreviewLink:g})=>O.jsx(Elu,{children:O.jsxs(A.Stack,{gap:3,display:"flex",flex:1,children:[O.jsx(A.Typography,{variant:"overline",color:"text.disabled",children:e??"PRÉ-VISUALIZAÇÃO"}),O.jsxs(klu,{children:[O.jsxs(A.Stack,{direction:"row",pb:3,gap:.5,children:[O.jsx(A.Box,{height:0,width:10,children:O.jsx(we,{icon:"CIRCLE",width:30,color:"error.main"})}),O.jsx(A.Box,{height:0,width:10,children:O.jsx(we,{icon:"CIRCLE",width:30,color:"warning.main"})}),O.jsx(A.Box,{height:0,width:10,children:O.jsx(we,{icon:"CIRCLE",width:30,color:"success.main"})})]}),O.jsxs(A.Stack,{flexDirection:"row",gap:2,justifyContent:"space-between",children:[O.jsxs(A.Stack,{gap:1,width:"100%",children:[O.jsxs(A.Stack,{direction:"row",gap:1.5,pb:.5,children:[t&&O.jsx(Slu,{children:O.jsx("img",{alt:"Logo",src:t})}),O.jsxs(A.Stack,{children:[O.jsx(A.Typography,{variant:"overline",color:"grey.600",pb:.5,children:n??"SUAEMPRESA"}),O.jsxs(A.Stack,{direction:"row",gap:2,children:[O.jsx(A.Typography,{variant:"caption",color:"grey.600",children:a??"https://www.exemplo.com"}),O.jsx(we,{icon:"MORE_OPTIONS_VERTICAL",width:15,color:"grey.500"})]})]})]}),O.jsx(Wj,{variant:"subtitle1",color:"#4E5BEC",overflow:"hidden",textOverflow:"ellipsis",line:5,children:r??"Suampresa | Páscoa 2024: Ovos de chocolate? Que nada! Descontos em tecnologia!"}),O.jsx(Wj,{variant:"caption",color:"text.disabled",overflow:"hidden",textOverflow:"ellipsis",line:5,children:u??"A Páscoa chegou e a Sua Empresa está com ofertas chocantes em tecnologia! Descontos de até 50% em notebooks, smartphones, tablets e muito mais!"}),c&&O.jsx(A.Stack,{direction:"row",gap:1,alignItems:"center",children:c.map((_,m)=>O.jsxs(O.Fragment,{children:[O.jsx(A.Typography,{variant:"caption",color:"text.disabled",children:_}),m<c.length-1&&O.jsx(A.Box,{width:4,height:16,children:O.jsx(we,{icon:"CIRCLE",color:"text.disabled",width:10})})]}))}),s&&O.jsx(A.Stack,{pt:2,children:s.map((_,m)=>O.jsxs(A.Stack,{gap:1,children:[O.jsx(A.Typography,{variant:"subtitle1",color:"#4E5BEC",children:_.title}),O.jsx(Wj,{variant:"caption",color:"text.disabled",overflow:"hidden",textOverflow:"ellipsis",line:1,children:_.description??"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys stansince the 1500"})]},m))}),d]}),l&&O.jsx(Dlu,{children:O.jsx("img",{alt:"ProductImage",src:l})})]})]}),g&&O.jsxs(A.Stack,{gap:3,display:"flex",flex:1,width:"100%",children:[O.jsx(A.Typography,{variant:"overline",color:"text.disabled",children:"pré-visualização link de compartilhamento".toUpperCase()}),O.jsxs(lYn,{children:[f&&O.jsx(Ilu,{children:O.jsx("img",{alt:"PreviewLinkImage",src:f,style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:8}})}),O.jsxs(A.Stack,{gap:.2,p:2,width:"100%",children:[O.jsx(A.Typography,{variant:"caption",children:r??"Suampresa | Páscoa 2024: Ovos de chocolate? Que nada! Descontos em tecnologia!"}),O.jsx(A.Typography,{variant:"caption",color:"grey.600",children:u??"A Páscoa chegou e a Sua Empresa está com ofertas chocantes em tecnologia! Descontos de até 50% em notebooks, smartphones, tablets e muito mais!"}),O.jsx(A.Typography,{variant:"caption",color:"grey.500",children:a??"https://www.exemplo.com"})]})]}),O.jsx(lYn,{children:O.jsxs(A.Stack,{direction:"row",gap:1,alignItems:"center",children:[O.jsx(A.Box,{width:100,height:95,bgcolor:"grey.100",p:.5,alignItems:"center",children:O.jsx("img",{alt:"Logo",src:t,style:{width:"100%",height:"100%",objectFit:"contain",borderRadius:8}})}),O.jsxs(A.Stack,{padding:1,gap:.2,width:"80%",children:[O.jsx(Wj,{variant:"caption",children:r??"Suampresa | Páscoa 2024: Ovos de chocolate? Que nada! Descontos em tecnologia!"}),O.jsx(Wj,{variant:"caption",color:"grey.600",children:u??"A Páscoa chegou e a Sua Empresa está com ofertas chocantes em tecnologia! Descontos de até 50% em notebooks, smartphones, tablets e muito mais!"}),O.jsx(Wj,{variant:"caption",color:"grey.500",line:1,children:a??"https://www.exemplo.com"})]})]})})]})]})}),Wlu=A.styled(iWn)(({theme:e})=>({backgroundColor:`${A.alpha(e.palette.grey[400],.2)}`,cursor:"pointer"})),$lu=A.styled(ZT)(()=>({maxHeight:"260px"})),xlu=({items:e})=>{const{setValue:t,getValues:n}=Re.useFormContext(),[a,r]=o.useState(-1),[u,c]=o.useState(""),s=Object.fromEntries(e.map((C,p)=>[p,[]])),[l,d]=o.useState(s);o.useEffect(()=>()=>{t("config",{})},[]);const f=(C,p)=>{r(p?C:-1),p&&g()},g=()=>{c("")},_=(C,p,y)=>{const S=y.target.checked?[...l[a],p]:l[a].filter(w=>w!==p);d({...l,[a]:S}),h(C,S)},m=C=>{c(C)},v=()=>{const p=e[a].list.every(y=>l[a].includes(y.value))?[]:[...e[a].list.map(y=>y.value)];d({...l,[a]:p}),h(e[a].name,p)},h=(C,p)=>{const y={},S=n("config"),w=e[a];if(w){const j=w.list.filter(b=>l[a].includes(b.value)).map(b=>b.value);y[w.name]={type:"FIELD",values:w.name===C?p:j},t("config",{...S,...y})}};return O.jsx(O.Fragment,{children:e.map((C,p)=>O.jsxs(A.Accordion,{expanded:a===p,onChange:(y,S)=>f(p,S),children:[O.jsx(A.AccordionSummary,{expandIcon:O.jsx(we,{icon:"CHEVRON_UP"}),id:`${p}`,children:O.jsxs(A.Stack,{alignItems:"center",direction:"row",children:[O.jsx(A.Typography,{variant:"subtitle2",color:"grey.600",children:C.label}),O.jsxs(Wlu,{variant:"soft",color:"primary",marginLeft:1,children:[l[p].length," selecionados"]})]})}),O.jsxs(A.AccordionDetails,{children:[O.jsxs(A.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",gap:1,children:[O.jsx(Fle,{onSearch:m,onChange:y=>m(y.target.value),iconPosition:"start",size:"small",placeholder:"Buscar",value:u,fullWidth:!0}),O.jsx(A.Button,{onClick:()=>v(),size:"small",children:O.jsx(A.Typography,{variant:"overline",children:"TODOS"})})]}),O.jsx($lu,{children:O.jsx(A.List,{children:a>-1&&(C.list.filter(y=>y.label.toLowerCase().includes(u.toLowerCase())).map((y,S)=>O.jsx(A.ListItem,{children:O.jsx(A.FormControlLabel,{control:O.jsx(A.Checkbox,{size:"small",checked:l[a].includes(y.value),onChange:w=>_(C.name,y.value,w),name:y.label}),label:O.jsx(A.Typography,{variant:"caption",color:"grey.600",children:y.label})})},S)).length===0?O.jsx(uvt,{sx:{svg:{height:100}},text:"Nenhum registro para ser apresentado"}):C.list.filter(y=>y.label.toLowerCase().includes(u.toLowerCase())).map((y,S)=>O.jsx(A.ListItem,{children:O.jsx(A.FormControlLabel,{control:O.jsx(A.Checkbox,{size:"small",checked:l[a].includes(y.value),onChange:w=>_(C.name,y.value,w),name:y.label}),label:O.jsx(A.Typography,{variant:"caption",color:"grey.600",children:y.label})})},S)))})})]})]},p))})},Alu=({columns:e,rows:t,loading:n,fetching:a,totalRows:r,handlePaginationChange:u})=>{const{setValue:c}=Re.useFormContext(),{apiRef:s,page:l,perPage:d}=zFn();o.useEffect(()=>()=>{c("config",{})},[]);const[f,g]=o.useState([]),[_,m]=o.useState(),v=C=>{g(C),c("config.products",{type:"FIELD",values:C})},h=()=>{const C=_==null?void 0:_.toLowerCase();return t.filter(p=>Object.values(p).some(y=>typeof y=="string"||y instanceof String?y.toLowerCase().includes(C||""):!1))};return O.jsxs(A.Stack,{gap:2,children:[O.jsxs(A.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[O.jsx(Fle,{onSearch:C=>m(C),onChange:C=>m(C.target.value),iconPosition:"start",size:"small",placeholder:"Buscar"}),O.jsxs(A.Typography,{variant:"body1",color:"text.disabled",children:[f.length," selecionados"]})]}),O.jsx(CBn,{apiRef:s,columns:e,rows:h(),pagination:!0,paginationModel:{page:l,pageSize:d},rowCount:r,paginationMode:"server",onPaginationModelChange:u,initialState:{pagination:{paginationModel:{pageSize:5,page:l}}},loading:n,fetching:a,checkboxSelection:!0,onRowSelectionModelChange:v})]})},Rlu=zt(A.ToggleButton)(({theme:e})=>({width:"100%","&.Mui-selected":{backgroundColor:e.palette.primary.main,color:e.palette.common.white,"&:hover":{backgroundColor:e.palette.primary.main}}})),zlu=zt(A.ToggleButtonGroup)(()=>({display:"flex",justifyContent:"space-between"})),Hlu=({rules:e})=>{const[t,n]=o.useState(),{setValue:a}=Re.useFormContext();o.useEffect(()=>{e&&e.length>0&&n(e[0].value)},[]),o.useEffect(()=>()=>{a("config",{})},[]);const r=(u,c)=>{c!==null&&n(c)};return O.jsxs(A.Stack,{gap:2,children:[O.jsx(pn,{name:"name",label:"Nome da regra",required:!0,rules:{required:{value:!0,message:"Nome da regra é obrigatório"}}}),O.jsx(A.Typography,{color:"grey.500",variant:"overline",children:"Selecione a regra"}),e&&O.jsx(zlu,{color:"primary",value:t,size:"small",exclusive:!0,onChange:r,children:e.map((u,c)=>O.jsx(Rlu,{value:u.value,size:"small",color:"primary",children:O.jsx(A.Typography,{variant:"body2",children:u.toggleTitle})},c))}),e&&e.map((u,c)=>u.value===t?O.jsx("div",{children:u.component},c):null)]})},Vlu=A.styled(A.ToggleButtonGroup)(({theme:e})=>({button:{textTransform:"none"},"& .MuiToggleButton-primary:hover":{backgroundColor:`${e.palette.primary.dark}`,color:e.palette.primary.contrastText},"& button:not(.Mui-selected):hover":{backgroundColor:e.palette.primary.lighter,color:e.palette.primary.main},"& .Mui-selected":{backgroundColor:`${e.palette.primary.main} !important`,color:`${e.palette.primary.contrastText} !important`}})),sYn=e=>O.jsx(Vlu,{...e});var fYn={exports:{}};(function(e,t){(function(){var n="ace",a=function(){return this}();!a&&typeof window<"u"&&(a=window);var r=function(f,g,_){if(typeof f!="string"){r.original?r.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(_=g),r.modules[f]||(r.payloads[f]=_,r.modules[f]=null)};r.modules={},r.payloads={};var u=function(f,g,_){if(typeof g=="string"){var m=l(f,g);if(m!=null)return _&&_(),m}else if(Object.prototype.toString.call(g)==="[object Array]"){for(var v=[],h=0,C=g.length;h<C;++h){var p=l(f,g[h]);if(p==null&&c.original)return;v.push(p)}return _&&_.apply(null,v)||!0}},c=function(f,g){var _=u("",f,g);return _==null&&c.original?c.original.apply(this,arguments):_},s=function(f,g){if(g.indexOf("!")!==-1){var _=g.split("!");return s(f,_[0])+"!"+s(f,_[1])}if(g.charAt(0)=="."){var m=f.split("/").slice(0,-1).join("/");for(g=m+"/"+g;g.indexOf(".")!==-1&&v!=g;){var v=g;g=g.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return g},l=function(f,g){g=s(f,g);var _=r.modules[g];if(!_){if(_=r.payloads[g],typeof _=="function"){var m={},v={id:g,uri:"",exports:m,packaged:!0},h=function(p,y){return u(g,p,y)},C=_(h,m,v);m=C||v.exports,r.modules[g]=m,delete r.payloads[g]}_=r.modules[g]=m||_}return _};function d(f){var g=a;f&&(a[f]||(a[f]={}),g=a[f]),(!g.define||!g.define.packaged)&&(r.original=g.define,g.define=r,g.define.packaged=!0),(!g.require||!g.require.packaged)&&(c.original=g.require,g.require=c,g.require.packaged=!0)}d(n)})(),ace.define("ace/lib/es6-shim",["require","exports","module"],function(n,a,r){function u(c,s,l){Object.defineProperty(c,s,{value:l,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||u(String.prototype,"startsWith",function(c,s){return s=s||0,this.lastIndexOf(c,s)===s}),String.prototype.endsWith||u(String.prototype,"endsWith",function(c,s){var l=this;(s===void 0||s>l.length)&&(s=l.length),s-=c.length;var d=l.indexOf(c,s);return d!==-1&&d===s}),String.prototype.repeat||u(String.prototype,"repeat",function(c){for(var s="",l=this;c>0;)c&1&&(s+=l),(c>>=1)&&(l+=l);return s}),String.prototype.includes||u(String.prototype,"includes",function(c,s){return this.indexOf(c,s)!=-1}),Object.assign||(Object.assign=function(c){if(c==null)throw new TypeError("Cannot convert undefined or null to object");for(var s=Object(c),l=1;l<arguments.length;l++){var d=arguments[l];d!=null&&Object.keys(d).forEach(function(f){s[f]=d[f]})}return s}),Object.values||(Object.values=function(c){return Object.keys(c).map(function(s){return c[s]})}),Array.prototype.find||u(Array.prototype,"find",function(c){for(var s=this.length,l=arguments[1],d=0;d<s;d++){var f=this[d];if(c.call(l,f,d,this))return f}}),Array.prototype.findIndex||u(Array.prototype,"findIndex",function(c){for(var s=this.length,l=arguments[1],d=0;d<s;d++){var f=this[d];if(c.call(l,f,d,this))return d}}),Array.prototype.includes||u(Array.prototype,"includes",function(c,s){return this.indexOf(c,s)!=-1}),Array.prototype.fill||u(Array.prototype,"fill",function(c){for(var s=this,l=s.length>>>0,d=arguments[1],f=d>>0,g=f<0?Math.max(l+f,0):Math.min(f,l),_=arguments[2],m=_===void 0?l:_>>0,v=m<0?Math.max(l+m,0):Math.min(m,l);g<v;)s[g]=c,g++;return s}),Array.of||u(Array,"of",function(){return Array.prototype.slice.call(arguments)})}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(n,a,r){n("./es6-shim")}),ace.define("ace/lib/deep_copy",["require","exports","module"],function(n,a,r){a.deepCopy=function u(c){if(typeof c!="object"||!c)return c;var s;if(Array.isArray(c)){s=[];for(var l=0;l<c.length;l++)s[l]=u(c[l]);return s}if(Object.prototype.toString.call(c)!=="[object Object]")return c;s={};for(var l in c)s[l]=u(c[l]);return s}}),ace.define("ace/lib/lang",["require","exports","module","ace/lib/deep_copy"],function(n,a,r){a.last=function(s){return s[s.length-1]},a.stringReverse=function(s){return s.split("").reverse().join("")},a.stringRepeat=function(s,l){for(var d="";l>0;)l&1&&(d+=s),(l>>=1)&&(s+=s);return d};var u=/^\s\s*/,c=/\s\s*$/;a.stringTrimLeft=function(s){return s.replace(u,"")},a.stringTrimRight=function(s){return s.replace(c,"")},a.copyObject=function(s){var l={};for(var d in s)l[d]=s[d];return l},a.copyArray=function(s){for(var l=[],d=0,f=s.length;d<f;d++)s[d]&&typeof s[d]=="object"?l[d]=this.copyObject(s[d]):l[d]=s[d];return l},a.deepCopy=n("./deep_copy").deepCopy,a.arrayToMap=function(s){for(var l={},d=0;d<s.length;d++)l[s[d]]=1;return l},a.createMap=function(s){var l=Object.create(null);for(var d in s)l[d]=s[d];return l},a.arrayRemove=function(s,l){for(var d=0;d<=s.length;d++)l===s[d]&&s.splice(d,1)},a.escapeRegExp=function(s){return s.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},a.escapeHTML=function(s){return(""+s).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},a.getMatchOffsets=function(s,l){var d=[];return s.replace(l,function(f){d.push({offset:arguments[arguments.length-2],length:f.length})}),d},a.deferredCall=function(s){var l=null,d=function(){l=null,s()},f=function(g){return f.cancel(),l=setTimeout(d,g||0),f};return f.schedule=f,f.call=function(){return this.cancel(),s(),f},f.cancel=function(){return clearTimeout(l),l=null,f},f.isPending=function(){return l},f},a.delayedCall=function(s,l){var d=null,f=function(){d=null,s()},g=function(_){d==null&&(d=setTimeout(f,_||l))};return g.delay=function(_){d&&clearTimeout(d),d=setTimeout(f,_||l)},g.schedule=g,g.call=function(){this.cancel(),s()},g.cancel=function(){d&&clearTimeout(d),d=null},g.isPending=function(){return d},g},a.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch{return!1}return!0},a.skipEmptyMatch=function(s,l,d){return d&&s.codePointAt(l)>65535?2:1}}),ace.define("ace/lib/useragent",["require","exports","module"],function(n,a,r){a.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},a.getOS=function(){return a.isMac?a.OS.MAC:a.isLinux?a.OS.LINUX:a.OS.WINDOWS};var u=typeof navigator=="object"?navigator:{},c=(/mac|win|linux/i.exec(u.platform)||["other"])[0].toLowerCase(),s=u.userAgent||"",l=u.appName||"";a.isWin=c=="win",a.isMac=c=="mac",a.isLinux=c=="linux",a.isIE=l=="Microsoft Internet Explorer"||l.indexOf("MSAppHost")>=0?parseFloat((s.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((s.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),a.isOldIE=a.isIE&&a.isIE<9,a.isGecko=a.isMozilla=s.match(/ Gecko\/\d+/),a.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",a.isWebKit=parseFloat(s.split("WebKit/")[1])||void 0,a.isChrome=parseFloat(s.split(" Chrome/")[1])||void 0,a.isSafari=parseFloat(s.split(" Safari/")[1])&&!a.isChrome||void 0,a.isEdge=parseFloat(s.split(" Edge/")[1])||void 0,a.isAIR=s.indexOf("AdobeAIR")>=0,a.isAndroid=s.indexOf("Android")>=0,a.isChromeOS=s.indexOf(" CrOS ")>=0,a.isIOS=/iPad|iPhone|iPod/.test(s)&&!window.MSStream,a.isIOS&&(a.isMac=!0),a.isMobile=a.isIOS||a.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(n,a,r){var u=n("./useragent"),c="http://www.w3.org/1999/xhtml";a.buildDom=function _(m,v,h){if(typeof m=="string"&&m){var C=document.createTextNode(m);return v&&v.appendChild(C),C}if(!Array.isArray(m))return m&&m.appendChild&&v&&v.appendChild(m),m;if(typeof m[0]!="string"||!m[0]){for(var p=[],y=0;y<m.length;y++){var S=_(m[y],v,h);S&&p.push(S)}return p}var w=document.createElement(m[0]),j=m[1],b=1;j&&typeof j=="object"&&!Array.isArray(j)&&(b=2);for(var y=b;y<m.length;y++)_(m[y],w,h);return b==2&&Object.keys(j).forEach(function(M){var P=j[M];M==="class"?w.className=Array.isArray(P)?P.join(" "):P:typeof P=="function"||M=="value"||M[0]=="$"?w[M]=P:M==="ref"?h&&(h[P]=w):M==="style"?typeof P=="string"&&(w.style.cssText=P):P!=null&&w.setAttribute(M,P)}),v&&v.appendChild(w),w},a.getDocumentHead=function(_){return _||(_=document),_.head||_.getElementsByTagName("head")[0]||_.documentElement},a.createElement=function(_,m){return document.createElementNS?document.createElementNS(m||c,_):document.createElement(_)},a.removeChildren=function(_){_.innerHTML=""},a.createTextNode=function(_,m){var v=m?m.ownerDocument:document;return v.createTextNode(_)},a.createFragment=function(_){var m=_?_.ownerDocument:document;return m.createDocumentFragment()},a.hasCssClass=function(_,m){var v=(_.className+"").split(/\s+/g);return v.indexOf(m)!==-1},a.addCssClass=function(_,m){a.hasCssClass(_,m)||(_.className+=" "+m)},a.removeCssClass=function(_,m){for(var v=_.className.split(/\s+/g);;){var h=v.indexOf(m);if(h==-1)break;v.splice(h,1)}_.className=v.join(" ")},a.toggleCssClass=function(_,m){for(var v=_.className.split(/\s+/g),h=!0;;){var C=v.indexOf(m);if(C==-1)break;h=!1,v.splice(C,1)}return h&&v.push(m),_.className=v.join(" "),h},a.setCssClass=function(_,m,v){v?a.addCssClass(_,m):a.removeCssClass(_,m)},a.hasCssString=function(_,m){var v=0,h;if(m=m||document,h=m.querySelectorAll("style")){for(;v<h.length;)if(h[v++].id===_)return!0}},a.removeElementById=function(_,m){m=m||document,m.getElementById(_)&&m.getElementById(_).remove()};var s,l=[];a.useStrictCSP=function(_){s=_,_==!1?d():l||(l=[])};function d(){var _=l;l=null,_&&_.forEach(function(m){f(m[0],m[1])})}function f(_,m,v){if(!(typeof document>"u")){if(l){if(v)d();else if(v===!1)return l.push([_,m])}if(!s){var h=v;!v||!v.getRootNode?h=document:(h=v.getRootNode(),(!h||h==v)&&(h=document));var C=h.ownerDocument||h;if(m&&a.hasCssString(m,h))return null;m&&(_+=`
35409
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JKn(e,t){if(e){if(typeof e=="string")return hWn(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 hWn(e,t)}}function hWn(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 Kcu(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,s;try{for(n=n.call(e);!(r=(c=n.next()).done)&&(a.push(c.value),!(t&&a.length===t));r=!0);}catch(l){u=!0,s=l}finally{try{!r&&n.return!=null&&n.return()}finally{if(u)throw s}}return a}}function Ycu(e){if(Array.isArray(e))return e}function qKn(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 Xt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qKn(Object(n),!0).forEach(function(a){CWn(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qKn(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function CWn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ubt(e,t){if(e==null)return{};var n=Xcu(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 Xcu(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 bWn=o.forwardRef(function(e,t){var n=e.children,a=Ubt(e,zcu),r=Gbt(a),u=r.open,c=Ubt(r,Hcu);return o.useImperativeHandle(t,function(){return{open:u}},[u]),o.createElement(o.Fragment,null,n(Xt(Xt({},c),{},{open:u})))});bWn.displayName="Dropzone";var eYn={disabled:!1,getFilesFromEvent:ccu,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};bWn.defaultProps=eYn,bWn.propTypes={children:F.func,accept:F.objectOf(F.arrayOf(F.string)),multiple:F.bool,preventDropOnDocument:F.bool,noClick:F.bool,noKeyboard:F.bool,noDrag:F.bool,noDragEventsBubbling:F.bool,minSize:F.number,maxSize:F.number,maxFiles:F.number,disabled:F.bool,getFilesFromEvent:F.func,onFileDialogCancel:F.func,onFileDialogOpen:F.func,useFsAccessApi:F.bool,autoFocus:F.bool,onDragEnter:F.func,onDragLeave:F.func,onDragOver:F.func,onDrop:F.func,onDropAccepted:F.func,onDropRejected:F.func,onError:F.func,validator:F.func};var yWn={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Gbt(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Xt(Xt({},eYn),e),n=t.accept,a=t.disabled,r=t.getFilesFromEvent,u=t.maxSize,c=t.minSize,s=t.multiple,l=t.maxFiles,d=t.onDragEnter,f=t.onDragLeave,g=t.onDragOver,_=t.onDrop,m=t.onDropAccepted,v=t.onDropRejected,h=t.onFileDialogCancel,C=t.onFileDialogOpen,p=t.useFsAccessApi,y=t.autoFocus,S=t.preventDropOnDocument,w=t.noClick,j=t.noKeyboard,b=t.noDrag,M=t.noDragEventsBubbling,P=t.onError,k=t.validator,W=o.useMemo(function(){return xcu(n)},[n]),I=o.useMemo(function(){return $cu(n)},[n]),D=o.useMemo(function(){return typeof C=="function"?C:tYn},[C]),E=o.useMemo(function(){return typeof h=="function"?h:tYn},[h]),L=o.useRef(null),B=o.useRef(null),$=o.useReducer(Qcu,yWn),x=vWn($,2),R=x[0],H=x[1],z=R.isFocused,N=R.isFileDialogActive,K=o.useRef(typeof window<"u"&&window.isSecureContext&&p&&Wcu()),Z=function(){!K.current&&N&&setTimeout(function(){if(B.current){var Le=B.current.files;Le.length||(H({type:"closeDialog"}),E())}},300)};o.useEffect(function(){return window.addEventListener("focus",Z,!1),function(){window.removeEventListener("focus",Z,!1)}},[B,N,E,K]);var T=o.useRef([]),U=function(Le){L.current&&L.current.contains(Le.target)||(Le.preventDefault(),T.current=[])};o.useEffect(function(){return S&&(document.addEventListener("dragover",YKn,!1),document.addEventListener("drop",U,!1)),function(){S&&(document.removeEventListener("dragover",YKn),document.removeEventListener("drop",U))}},[L,S]),o.useEffect(function(){return!a&&y&&L.current&&L.current.focus(),function(){}},[L,y,a]);var Y=o.useCallback(function(me){P?P(me):console.error(me)},[P]),te=o.useCallback(function(me){me.preventDefault(),me.persist(),We(me),T.current=[].concat(Ncu(T.current),[me.target]),Zbt(me)&&Promise.resolve(r(me)).then(function(Le){if(!(Tbt(me)&&!M)){var ae=Le.length,le=ae>0&&Scu({files:Le,accept:W,minSize:c,maxSize:u,multiple:s,maxFiles:l,validator:k}),ye=ae>0&&!le;H({isDragAccept:le,isDragReject:ye,isDragActive:!0,type:"setDraggedFiles"}),d&&d(me)}}).catch(function(Le){return Y(Le)})},[r,d,Y,M,W,c,u,s,l,k]),re=o.useCallback(function(me){me.preventDefault(),me.persist(),We(me);var Le=Zbt(me);if(Le&&me.dataTransfer)try{me.dataTransfer.dropEffect="copy"}catch{}return Le&&g&&g(me),!1},[g,M]),q=o.useCallback(function(me){me.preventDefault(),me.persist(),We(me);var Le=T.current.filter(function(le){return L.current&&L.current.contains(le)}),ae=Le.indexOf(me.target);ae!==-1&&Le.splice(ae,1),T.current=Le,!(Le.length>0)&&(H({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Zbt(me)&&f&&f(me))},[L,f,M]),ie=o.useCallback(function(me,Le){var ae=[],le=[];me.forEach(function(ye){var ge=GKn(ye,W),Be=vWn(ge,2),Qe=Be[0],dt=Be[1],vt=KKn(ye,c,u),ut=vWn(vt,2),Ye=ut[0],$t=ut[1],kn=k?k(ye):null;if(Qe&&Ye&&!kn)ae.push(ye);else{var e1=[dt,$t];kn&&(e1=e1.concat(kn)),le.push({file:ye,errors:e1.filter(function(xn){return xn})})}}),(!s&&ae.length>1||s&&l>=1&&ae.length>l)&&(ae.forEach(function(ye){le.push({file:ye,errors:[kcu]})}),ae.splice(0)),H({acceptedFiles:ae,fileRejections:le,type:"setFiles"}),_&&_(ae,le,Le),le.length>0&&v&&v(le,Le),ae.length>0&&m&&m(ae,Le)},[H,s,W,c,u,l,_,m,v,k]),de=o.useCallback(function(me){me.preventDefault(),me.persist(),We(me),T.current=[],Zbt(me)&&Promise.resolve(r(me)).then(function(Le){Tbt(me)&&!M||ie(Le,me)}).catch(function(Le){return Y(Le)}),H({type:"reset"})},[r,ie,Y,M]),oe=o.useCallback(function(){if(K.current){H({type:"openDialog"}),D();var me={multiple:s,types:I};window.showOpenFilePicker(me).then(function(Le){return r(Le)}).then(function(Le){ie(Le,null),H({type:"closeDialog"})}).catch(function(Le){Acu(Le)?(E(Le),H({type:"closeDialog"})):Rcu(Le)?(K.current=!1,B.current?(B.current.value=null,B.current.click()):Y(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."))):Y(Le)});return}B.current&&(H({type:"openDialog"}),D(),B.current.value=null,B.current.click())},[H,D,E,p,ie,Y,I,s]),ze=o.useCallback(function(me){!L.current||!L.current.isEqualNode(me.target)||(me.key===" "||me.key==="Enter"||me.keyCode===32||me.keyCode===13)&&(me.preventDefault(),oe())},[L,oe]),_e=o.useCallback(function(){H({type:"focus"})},[]),ue=o.useCallback(function(){H({type:"blur"})},[]),he=o.useCallback(function(){w||(Bcu()?setTimeout(oe,0):oe())},[w,oe]),Me=function(Le){return a?null:Le},se=function(Le){return j?null:Me(Le)},Se=function(Le){return b?null:Me(Le)},We=function(Le){M&&Le.stopPropagation()},Ge=o.useMemo(function(){return function(){var me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Le=me.refKey,ae=Le===void 0?"ref":Le,le=me.role,ye=me.onKeyDown,ge=me.onFocus,Be=me.onBlur,Qe=me.onClick,dt=me.onDragEnter,vt=me.onDragOver,ut=me.onDragLeave,Ye=me.onDrop,$t=Ubt(me,Vcu);return Xt(Xt(CWn({onKeyDown:se(il(ye,ze)),onFocus:se(il(ge,_e)),onBlur:se(il(Be,ue)),onClick:Me(il(Qe,he)),onDragEnter:Se(il(dt,te)),onDragOver:Se(il(vt,re)),onDragLeave:Se(il(ut,q)),onDrop:Se(il(Ye,de)),role:typeof le=="string"&&le!==""?le:"presentation"},ae,L),!a&&!j?{tabIndex:0}:{}),$t)}},[L,ze,_e,ue,he,te,re,q,de,j,b,a]),Ze=o.useCallback(function(me){me.stopPropagation()},[]),It=o.useMemo(function(){return function(){var me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Le=me.refKey,ae=Le===void 0?"ref":Le,le=me.onChange,ye=me.onClick,ge=Ubt(me,Fcu),Be=CWn({accept:W,multiple:s,type:"file",style:{display:"none"},onChange:Me(il(le,de)),onClick:Me(il(ye,Ze)),tabIndex:-1},ae,B);return Xt(Xt({},Be),ge)}},[B,n,s,de,a]);return Xt(Xt({},R),{},{isFocused:z&&!a,getRootProps:Ge,getInputProps:It,rootRef:L,inputRef:B,open:Me(oe)})}function Qcu(e,t){switch(t.type){case"focus":return Xt(Xt({},e),{},{isFocused:!0});case"blur":return Xt(Xt({},e),{},{isFocused:!1});case"openDialog":return Xt(Xt({},yWn),{},{isFileDialogActive:!0});case"closeDialog":return Xt(Xt({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Xt(Xt({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Xt(Xt({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Xt({},yWn);default:return e}}function tYn(){}const nYn=({fileRejections:e})=>e.length?O.jsx(A.Paper,{variant:"outlined",sx:{py:1,px:2,mt:3,bgcolor:t=>ve(t.palette.error.main,.08),borderColor:t=>ve(t.palette.error.main,.24)},children:e.map(({file:t,errors:n})=>{const{path:a,size:r}=gWn(t);return O.jsxs(A.Box,{sx:{my:1},children:[O.jsxs(A.Typography,{variant:"subtitle2",noWrap:!0,children:[a," - ",r?eWn(r):""]}),n.map(u=>O.jsxs(A.Box,{component:"span",sx:{typography:"caption"},children:["- ",u.message]},u.code))]},a)})}):null,Jcu=({file:e})=>{if(!e)return null;const t=typeof e=="string"?e:e.preview;return O.jsx(A.Stack,{position:"absolute",width:1,height:1,maxHeight:"100%",alignItems:"center",justifyContent:"center",top:0,right:0,bottom:0,left:0,padding:2,margin:"auto",children:O.jsx("img",{alt:"file preview",src:t,style:{borderRadius:8,width:"auto",maxWidth:"100%",maxHeight:"100%",height:"auto"}})})},qcu=zt("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 ${ve(e.palette.grey[500],.32)}`,"&:hover":{opacity:.72}})),elu=({header:e,description:t,sx:n,...a})=>O.jsxs(A.Stack,{spacing:5,alignItems:"center",justifyContent:"center",direction:{xs:"column",md:"row"},sx:{width:1,textAlign:{xs:"center",md:"left"},...n},...a,children:[O.jsx(jxn,{sx:{width:220}}),O.jsxs("div",{children:[O.jsx(A.Typography,{gutterBottom:!0,variant:"h5",children:e||"Soltar ou selecionar arquivos"}),O.jsx(A.Typography,{variant:"body2",sx:{color:"text.secondary"},children:t||O.jsxs(O.Fragment,{children:["Solte os arquivos aqui ou clique",O.jsx(A.Typography,{variant:"body2",component:"span",sx:{mx:.5,color:"primary.main",textDecoration:"underline"},children:"procurar"}),"na sua máquina"]})})]})]}),rYn=({id:e,disabled:t,multiple:n=!1,error:a,helperText:r,file:u,onDelete:c,files:s,thumbnail:l,onRemove:d,onHandleMainImage:f,mainUrl:g,sx:_,dropZoneProps:m,placeholderProps:v,placeholderAlt:h,image:C,tabIndex:p,...y})=>{const{getRootProps:S,getInputProps:w,isDragActive:j,isDragReject:b,fileRejections:M}=Gbt({multiple:n,disabled:t,...y}),P=!!u&&!n||C,k=s&&n&&s.length>0,W=b||!!a;return O.jsxs(A.Box,{sx:{width:1,position:"relative",..._},children:[O.jsxs(qcu,{...S(),sx:{...j&&{opacity:.72},...W&&{color:"error.main",bgcolor:"error.lighter",borderColor:"error.light"},...t&&{opacity:.48,pointerEvents:"none"},...m},children:[O.jsx("input",{...w(),id:e,tabIndex:p}),h?O.jsx(A.Stack,{sx:{...P&&{opacity:0}},children:h}):O.jsx(elu,{sx:{...P&&{opacity:0}},header:v==null?void 0:v.title,description:v==null?void 0:v.description}),P&&O.jsx(Jcu,{file:u||C||""})]}),r&&O.jsx(A.FormHelperText,{error:!!a,sx:I=>({mx:"14px",color:t?I.palette.grey[500]:void 0}),children:r}),O.jsx(nYn,{fileRejections:M}),P&&c&&O.jsx(A.IconButton,{size:"small",onClick:c,sx:{top:16,right:16,zIndex:9,position:"absolute",color:I=>ve(I.palette.common.white,.8),bgcolor:I=>ve(I.palette.grey[900],.72),"&:hover":{bgcolor:I=>ve(I.palette.grey[900],.48)}},children:O.jsx(we,{icon:"CLOSE_MARK_BUTTON",width:18})}),k&&O.jsx(O.Fragment,{children:O.jsx(A.Box,{sx:{my:3},children:O.jsx(acu,{files:s,thumbnail:l,onRemove:d,onHandleMainImage:f,mainUrl:g})})})]})},tlu=({file:e})=>{if(!e)return null;const t=typeof e=="string"?e:e.preview;return O.jsx("img",{alt:"avatar",src:t,style:{zIndex:8,overflow:"hidden",borderRadius:"50%",position:"absolute",width:"calc(100% - 16px)",height:"calc(100% - 16px)"}})},nlu=zt("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 ${ve(e.palette.grey[500],.32)}`})),rlu=zt("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})})),aYn=({error:e,file:t,image:n,disabled:a,helperText:r,sx:u,tabIndex:c,...s})=>{const{getRootProps:l,getInputProps:d,isDragActive:f,isDragReject:g,fileRejections:_}=Gbt({multiple:!1,disabled:a,...s}),m=!!t||n,v=g||!!e;return O.jsxs(O.Fragment,{children:[O.jsxs(nlu,{...l(),sx:{...f&&{opacity:.72},...v&&{borderColor:"error.light",...m&&{bgcolor:"error.lighter"}},...a&&{opacity:.48,pointerEvents:"none"},...m&&{"&:hover":{"& .placeholder":{opacity:1}}},...u},children:[O.jsx("input",{...d(),tabIndex:c}),m&&O.jsx(tlu,{file:t||n||""}),O.jsxs(rlu,{className:"placeholder",sx:{"&:hover":{opacity:.72},...m&&{zIndex:9,opacity:0,color:"common.white",bgcolor:h=>ve(h.palette.grey[900],.64)},...v&&{color:"error.main",bgcolor:"error.lighter"}},children:[O.jsx(we,{icon:"ADD_IMAGE",width:24,sx:{mb:1}}),O.jsx(A.Typography,{variant:"caption",children:t?"Atualizar foto":"Carregar foto"})]})]}),r&&r,O.jsx(nYn,{fileRejections:_})]})},alu=zt("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:ve(e.palette.grey[500],.08),"&:hover":{opacity:.72}})),ilu=({placeholderAlt:e,error:t,disabled:n,sx:a,tabIndex:r,...u})=>{const{getRootProps:c,getInputProps:s,isDragActive:l,isDragReject:d}=Gbt({disabled:n,...u}),f=d||t;return O.jsxs(alu,{...c(),sx:{...l&&{opacity:.72},...f&&{color:"error.main",bgcolor:"error.lighter",borderColor:"error.light"},...n&&{opacity:.48,pointerEvents:"none"},...a},children:[O.jsx("input",{...s(),tabIndex:r}),e||O.jsx(we,{icon:"CLOUD_UPLOAD",width:28})]})},iYn=({onFileCropped:e,onImageUploaded:t,onCancel:n})=>{const a=o.useId(),[r,u]=o.useState(),[c,s,l]=xmt(),[d,f]=o.useState();return{id:a,setCropModalOpen:l,handleRemove:()=>{e(void 0),t(void 0),l(!1)},toggleCropModalOpen:s,cropModalOpen:c,cancelChanges:()=>{n&&n(),l(!1)},saveChanges:()=>{r!==void 0&&r.getCroppedCanvas().toBlob(C=>{if(!C)return;const p=new File([C],"imagem");e(p),s()},"image/png",1)},previewImage:()=>{r!==void 0&&f(r.getCroppedCanvas().toDataURL())},setCropper:u,preview:d,closePreviewImage:()=>f(void 0)}},oYn=({id:e,open:t,onClose:n,label:a,onSave:r,onRemove:u,onPreview:c,imageSrc:s,aspectRatio:l,onInitialized:d})=>{const[f,g]=o.useState(.5);return O.jsx(MKn,{open:t,onClose:n,dialogTitle:a,actions:O.jsxs(O.Fragment,{children:[O.jsx(A.Button,{variant:"outlined",size:"medium",onClick:n,color:"inherit",children:"Cancelar"}),O.jsx(A.Button,{variant:"contained",size:"medium",onClick:r,children:"Salvar"})]}),fullWidth:!0,maxWidth:"sm",keepMounted:!0,children:O.jsxs(A.Stack,{gap:2,children:[O.jsx(tKn,{imageSrc:s,aspectRatio:l,onInitialized:d,zoom:f,onZoomChange:g}),O.jsxs(A.Stack,{gap:1.5,children:[O.jsxs(A.Stack,{width:1,direction:"row",gap:3,flex:1,alignItems:"center",children:[O.jsx(A.Typography,{variant:"body1",children:"Zoom"}),O.jsx(A.Slider,{value:f,onChange:(_,m)=>g(Array.isArray(m)?m[0]:m),min:.1,max:2,size:"medium",step:.0125})]}),O.jsxs(A.Stack,{direction:"row",gap:2,children:[O.jsx(A.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:O.jsx(we,{icon:"DELETE_MARK_BUTTON_02"}),onClick:u,children:"Remover"}),O.jsx(A.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:O.jsx(we,{icon:"PLAY_SIMPLE"}),onClick:c,children:"Pré-visualizar"}),O.jsx(A.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:O.jsx(we,{icon:"SEARCH_IMAGE"}),component:"label",htmlFor:e,children:"Alterar"})]})]})]})})},olu=A.styled(A.Stack)({position:"relative",width:"100%",borderRadius:8,overflow:"hidden","&:hover .actions":{display:"flex"}}),ulu=A.styled(A.Stack)(({theme:e})=>({display:"none",position:"absolute",alignItems:"center",justifyContent:"center",flexDirection:"row",gap:12,width:"100%",height:"100%",backgroundColor:A.alpha(e.palette.primary.main,.9),zIndex:999,button:{"&, &:hover, &:focus":{backgroundColor:"#fff"}}})),clu=A.styled(A.CircularProgress)({position:"absolute",width:"100%",height:"100%",zIndex:99,backgroundColor:"#fff",borderRadius:"50%"}),uYn=({onFileCropped:e,onImageUploaded:t,onCancel:n,aspect:a,label:r,image:u="",uploading:c,file:s,tabIndex:l,...d})=>{const{id:f,setCropModalOpen:g,handleRemove:_,toggleCropModalOpen:m,cropModalOpen:v,cancelChanges:h,saveChanges:C,previewImage:p,setCropper:y,preview:S,closePreviewImage:w}=iYn({onFileCropped:e,onImageUploaded:t,onCancel:n});return O.jsxs(O.Fragment,{children:[O.jsxs(olu,{children:[c&&O.jsx(Obt,{}),O.jsx(rYn,{...d,id:f,file:s,onDrop:j=>{if(j.length>0){g(!0);const b=new FileReader;b.addEventListener("load",()=>{var P;const M=((P=b.result)==null?void 0:P.toString())||"";t(M),e(void 0)}),b.readAsDataURL(j[0])}},image:u,tabIndex:l}),(s||u)&&O.jsxs(ulu,{className:"actions",children:[O.jsx(A.Button,{color:"inherit",startIcon:O.jsx(we,{icon:"DELETE_MARK_BUTTON_02",color:"error.main"}),onClick:_,children:"Remover"}),O.jsx(A.Button,{color:"inherit",startIcon:O.jsx(we,{icon:"SEARCH_IMAGE",color:"primary.maon"}),onClick:m,children:"Editar"})]})]}),O.jsx(oYn,{id:f,open:v,onClose:h,label:r,aspectRatio:a,imageSrc:u,onRemove:_,onSave:C,onPreview:p,onInitialized:y}),O.jsx(A.Dialog,{open:!!S,onClose:w,scroll:"body",PaperProps:{sx:{p:2}},children:S&&O.jsx("img",{src:S,alt:"Preview"})})]})},llu=A.styled(A.Stack)(({theme:e})=>({backgroundColor:"#fff",border:`1px solid ${e.palette.grey[300]}`})),cYn=({children:e,...t})=>O.jsx(llu,{borderRadius:1,gap:3,padding:3,...t,children:e}),slu=A.styled(A.Box)(()=>({marginLeft:"4px",fontWeight:"fontWeightBold"})),flu=A.styled(A.Button)(()=>({fontWeight:"fontWeightSemiBold"})),dlu=A.styled(we)(({theme:e})=>({color:e.palette.primary.main})),glu=({selectedTitle:e,onSelect:t,options:n})=>{const a=Amt();return O.jsxs(O.Fragment,{children:[O.jsx(flu,{disableRipple:!0,color:"inherit",onClick:a.onOpen,endIcon:O.jsx(dlu,{icon:a.open?"CHEVRON_UP":"ARROW_DOWN_SIMPLE"}),children:O.jsx(slu,{component:"span",children:e.label})}),O.jsx(wKn,{open:a.open,onClose:a.onClose,children:n.map(r=>O.jsx(A.MenuItem,{selected:r.value===e.value,onClick:()=>{a.onClose(),t(r.value)},children:r.label},r.value))})]})},_lu=A.styled(A.Stack)({display:"grid",gridTemplateColumns:"auto auto"}),mlu=A.styled(A.Typography)(({theme:e})=>({color:e.palette.grey[600]})),vlu=A.styled(A.Typography)(({theme:e})=>({textAlign:"right",color:e.palette.grey[800]})),hlu=({data:e,...t})=>e.length===0?null:O.jsx(_lu,{gap:1,...t,children:e.map(n=>[O.jsx(mlu,{variant:"body2",children:n.label},`label:${n.id}`),O.jsx(vlu,{variant:"body2",children:n.value},`value:${n.id}`)])}),Clu=A.styled(A.Stack)(({theme:e})=>({backgroundColor:"#fff",minWidth:"250px",padding:24,minHeight:"100vh",borderRight:`1px solid ${e.palette.grey[300]}`})),blu=A.styled(A.Stack)(({theme:e})=>({backgroundColor:"#fff",position:"sticky",top:0,zIndex:999,width:"100%",padding:24,gap:24,borderBottom:`1px solid ${e.palette.grey[300]}`})),ylu=A.styled(A.Stack)({flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:24}),plu=A.styled(A.Stack)(({theme:e})=>({height:"100%",width:"50%",flex:1,[e.breakpoints.down(1680)]:{width:"70%"}})),Olu=A.styled(A.Typography)(({theme:e})=>({color:e.palette.grey[800],fontSize:18,fontWeight:700})),jlu=A.styled(A.Typography)(({theme:e})=>({color:e.palette.grey[500],fontSize:14,fontWeight:400,paddingBottom:24})),wlu=A.styled(A.Button)(({theme:e})=>({paddingTop:6,paddingBottom:6,paddingLeft:0,margin:0,marginBottom:4,marginTop:4,width:"100%",display:"block",cursor:"pointer",color:e.palette.grey[600],textAlign:"left",fontWeight:400,fontSize:14,"> span":{color:e.palette.error.main}})),Mlu=A.styled(ZT)(()=>({height:1,"& .simplebar-content":{height:1}})),Llu=A.styled(A.Stack)(()=>({position:"fixed",width:"202px"})),Plu=({title:e,sections:t,headerLeftContent:n,headerRightContent:a,onClickBack:r})=>O.jsx(A.Stack,{children:O.jsxs(A.Stack,{direction:"row",children:[O.jsx(Clu,{children:O.jsx(Mlu,{children:O.jsxs(Llu,{children:[O.jsx(A.Typography,{variant:"overline",color:"text.disabled",fontWeight:700,children:"ACESSO RÁPIDO"}),t.map((u,c)=>O.jsxs(A.Stack,{children:[O.jsxs(wlu,{onClick:()=>{u.ref.current&&u.ref.current.scrollIntoView({block:"end",behavior:"smooth"})},children:[u.title,u.isRequired&&O.jsx("span",{children:"*"})]}),c<t.length-1&&O.jsx(A.Divider,{})]},c))]})})}),O.jsxs(A.Stack,{width:"100%",alignItems:"center",mb:8,children:[O.jsx(blu,{children:O.jsxs(ylu,{children:[O.jsxs(A.Stack,{flexDirection:"row",gap:2,children:[O.jsx(A.IconButton,{color:"primary",onClick:()=>r(),children:O.jsx(we,{icon:"CHEVRON_LEFT"})}),O.jsx(A.Typography,{variant:"h4",children:e}),n]}),O.jsxs(A.Stack,{direction:"row",gap:2,alignItems:"center",minWidth:"max-content",children:[O.jsx(xDn,{disabled:!0}),a]})]})}),O.jsx(plu,{children:t.map(u=>O.jsxs(A.Stack,{ref:u.ref,paddingTop:3,paddingBottom:2,alignItems:"start",width:"100%",children:[O.jsx(Olu,{children:u.title}),O.jsx(jlu,{children:u.subTitle}),O.jsx(cYn,{width:"100%",borderRadius:1,gap:1.5,padding:3,children:u.child})]},u.title))})]})]})}),Elu=A.styled(A.Box)(({theme:e})=>({padding:24,borderRadius:8,height:"auto",maxWidth:800,backgroundColor:e.palette.background.default,border:`1px solid ${e.palette.grey[300]}`})),klu=A.styled(A.Stack)(({theme:e})=>({minHeight:180,maxWidth:700,border:`4px dotted ${e.palette.grey[300]}`,borderRadius:8,backgroundColor:"#fff",padding:24})),Slu=A.styled(A.Box)(()=>({maxWidth:70,maxHeight:40,alignItems:"center","&, img":{flex:1,display:"flex",objectFit:"cover",borderRadius:8}})),Dlu=A.styled(A.Box)(({theme:e})=>({backgroundColor:e.palette.background.default,maxWidth:90,maxHeight:80,alignItems:"center","&, img":{flex:1,display:"flex",objectFit:"cover",borderRadius:8}})),lYn=A.styled(A.Stack)(({theme:e})=>({border:`4px dotted ${e.palette.grey[300]}`,borderRadius:8,backgroundColor:"#fff"})),Ilu=A.styled(A.Box)(({theme:e})=>({width:"auto",height:120,overflow:"hidden",padding:2,borderBottom:`4px dotted ${e.palette.grey[300]}`})),Blu=({titlePreview:e,logoImage:t,brandingName:n,url:a,title:r,description:u,keyWords:c,customTitles:s,productImage:l,child:d,previewLinkImage:f,hasPreviewLink:g})=>O.jsx(Elu,{children:O.jsxs(A.Stack,{gap:3,display:"flex",flex:1,children:[O.jsx(A.Typography,{variant:"overline",color:"text.disabled",children:e??"PRÉ-VISUALIZAÇÃO"}),O.jsxs(klu,{children:[O.jsxs(A.Stack,{direction:"row",pb:3,gap:.5,children:[O.jsx(A.Box,{height:0,width:10,children:O.jsx(we,{icon:"CIRCLE",width:30,color:"error.main"})}),O.jsx(A.Box,{height:0,width:10,children:O.jsx(we,{icon:"CIRCLE",width:30,color:"warning.main"})}),O.jsx(A.Box,{height:0,width:10,children:O.jsx(we,{icon:"CIRCLE",width:30,color:"success.main"})})]}),O.jsxs(A.Stack,{flexDirection:"row",gap:2,justifyContent:"space-between",children:[O.jsxs(A.Stack,{gap:1,width:"100%",children:[O.jsxs(A.Stack,{direction:"row",gap:1.5,pb:.5,children:[t&&O.jsx(Slu,{children:O.jsx("img",{alt:"Logo",src:t})}),O.jsxs(A.Stack,{children:[O.jsx(A.Typography,{variant:"overline",color:"grey.600",pb:.5,children:n??"SUAEMPRESA"}),O.jsxs(A.Stack,{direction:"row",gap:2,children:[O.jsx(A.Typography,{variant:"caption",color:"grey.600",children:a??"https://www.exemplo.com"}),O.jsx(we,{icon:"MORE_OPTIONS_VERTICAL",width:15,color:"grey.500"})]})]})]}),O.jsx(Wj,{variant:"subtitle1",color:"#4E5BEC",overflow:"hidden",textOverflow:"ellipsis",line:5,children:r??"Suampresa | Páscoa 2024: Ovos de chocolate? Que nada! Descontos em tecnologia!"}),O.jsx(Wj,{variant:"caption",color:"text.disabled",overflow:"hidden",textOverflow:"ellipsis",line:5,children:u??"A Páscoa chegou e a Sua Empresa está com ofertas chocantes em tecnologia! Descontos de até 50% em notebooks, smartphones, tablets e muito mais!"}),c&&O.jsx(A.Stack,{direction:"row",gap:1,alignItems:"center",children:c.map((_,m)=>O.jsxs(O.Fragment,{children:[O.jsx(A.Typography,{variant:"caption",color:"text.disabled",children:_}),m<c.length-1&&O.jsx(A.Box,{width:4,height:16,children:O.jsx(we,{icon:"CIRCLE",color:"text.disabled",width:10})})]}))}),s&&O.jsx(A.Stack,{pt:2,children:s.map((_,m)=>O.jsxs(A.Stack,{gap:1,children:[O.jsx(A.Typography,{variant:"subtitle1",color:"#4E5BEC",children:_.title}),O.jsx(Wj,{variant:"caption",color:"text.disabled",overflow:"hidden",textOverflow:"ellipsis",line:1,children:_.description??"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys stansince the 1500"})]},m))}),d]}),l&&O.jsx(Dlu,{children:O.jsx("img",{alt:"ProductImage",src:l})})]})]}),g&&O.jsxs(A.Stack,{gap:3,display:"flex",flex:1,width:"100%",children:[O.jsx(A.Typography,{variant:"overline",color:"text.disabled",children:"pré-visualização link de compartilhamento".toUpperCase()}),O.jsxs(lYn,{children:[f&&O.jsx(Ilu,{children:O.jsx("img",{alt:"PreviewLinkImage",src:f,style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:8}})}),O.jsxs(A.Stack,{gap:.2,p:2,width:"100%",children:[O.jsx(A.Typography,{variant:"caption",children:r??"Suampresa | Páscoa 2024: Ovos de chocolate? Que nada! Descontos em tecnologia!"}),O.jsx(A.Typography,{variant:"caption",color:"grey.600",children:u??"A Páscoa chegou e a Sua Empresa está com ofertas chocantes em tecnologia! Descontos de até 50% em notebooks, smartphones, tablets e muito mais!"}),O.jsx(A.Typography,{variant:"caption",color:"grey.500",children:a??"https://www.exemplo.com"})]})]}),O.jsx(lYn,{children:O.jsxs(A.Stack,{direction:"row",gap:1,alignItems:"center",children:[O.jsx(A.Box,{width:100,height:95,bgcolor:"grey.100",p:.5,alignItems:"center",children:O.jsx("img",{alt:"Logo",src:t,style:{width:"100%",height:"100%",objectFit:"contain",borderRadius:8}})}),O.jsxs(A.Stack,{padding:1,gap:.2,width:"80%",children:[O.jsx(Wj,{variant:"caption",children:r??"Suampresa | Páscoa 2024: Ovos de chocolate? Que nada! Descontos em tecnologia!"}),O.jsx(Wj,{variant:"caption",color:"grey.600",children:u??"A Páscoa chegou e a Sua Empresa está com ofertas chocantes em tecnologia! Descontos de até 50% em notebooks, smartphones, tablets e muito mais!"}),O.jsx(Wj,{variant:"caption",color:"grey.500",line:1,children:a??"https://www.exemplo.com"})]})]})})]})]})}),Wlu=A.styled(iWn)(({theme:e})=>({backgroundColor:`${A.alpha(e.palette.grey[400],.2)}`,cursor:"pointer"})),$lu=A.styled(ZT)(()=>({maxHeight:"260px"})),xlu=({items:e})=>{const{setValue:t,getValues:n}=Re.useFormContext(),[a,r]=o.useState(-1),[u,c]=o.useState(""),s=Object.fromEntries(e.map((C,p)=>[p,[]])),[l,d]=o.useState(s);o.useEffect(()=>()=>{t("config",{})},[]);const f=(C,p)=>{r(p?C:-1),p&&g()},g=()=>{c("")},_=(C,p,y)=>{const S=y.target.checked?[...l[a],p]:l[a].filter(w=>w!==p);d({...l,[a]:S}),h(C,S)},m=C=>{c(C)},v=()=>{const p=e[a].list.every(y=>l[a].includes(y.value))?[]:[...e[a].list.map(y=>y.value)];d({...l,[a]:p}),h(e[a].name,p)},h=(C,p)=>{const y={},S=n("config"),w=e[a];if(w){const j=w.list.filter(b=>l[a].includes(b.value)).map(b=>b.value);y[w.name]={type:"FIELD",values:w.name===C?p:j},t("config",{...S,...y})}};return O.jsx(O.Fragment,{children:e.map((C,p)=>O.jsxs(A.Accordion,{expanded:a===p,onChange:(y,S)=>f(p,S),children:[O.jsx(A.AccordionSummary,{expandIcon:O.jsx(we,{icon:"CHEVRON_UP"}),id:`${p}`,children:O.jsxs(A.Stack,{alignItems:"center",direction:"row",children:[O.jsx(A.Typography,{variant:"subtitle2",color:"grey.600",children:C.label}),O.jsxs(Wlu,{variant:"soft",color:"primary",marginLeft:1,children:[l[p].length," selecionados"]})]})}),O.jsxs(A.AccordionDetails,{children:[O.jsxs(A.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",gap:1,children:[O.jsx(Fle,{onSearch:m,onChange:y=>m(y.target.value),iconPosition:"start",size:"small",placeholder:"Buscar",value:u,fullWidth:!0}),O.jsx(A.Button,{onClick:()=>v(),size:"small",children:O.jsx(A.Typography,{variant:"overline",children:"TODOS"})})]}),O.jsx($lu,{children:O.jsx(A.List,{children:a>-1&&(C.list.filter(y=>y.label.toLowerCase().includes(u.toLowerCase())).map((y,S)=>O.jsx(A.ListItem,{children:O.jsx(A.FormControlLabel,{control:O.jsx(A.Checkbox,{size:"small",checked:l[a].includes(y.value),onChange:w=>_(C.name,y.value,w),name:y.label}),label:O.jsx(A.Typography,{variant:"caption",color:"grey.600",children:y.label})})},S)).length===0?O.jsx(uvt,{sx:{svg:{height:100}},text:"Nenhum registro para ser apresentado"}):C.list.filter(y=>y.label.toLowerCase().includes(u.toLowerCase())).map((y,S)=>O.jsx(A.ListItem,{children:O.jsx(A.FormControlLabel,{control:O.jsx(A.Checkbox,{size:"small",checked:l[a].includes(y.value),onChange:w=>_(C.name,y.value,w),name:y.label}),label:O.jsx(A.Typography,{variant:"caption",color:"grey.600",children:y.label})})},S)))})})]})]},p))})},Alu=({columns:e,rows:t,loading:n,fetching:a,totalRows:r,handlePaginationChange:u})=>{const{setValue:c}=Re.useFormContext(),{apiRef:s,page:l,perPage:d}=zFn();o.useEffect(()=>()=>{c("config",{})},[]);const[f,g]=o.useState([]),[_,m]=o.useState(),v=C=>{g(C),c("config.products",{type:"FIELD",values:C})},h=()=>{const C=_==null?void 0:_.toLowerCase();return t.filter(p=>Object.values(p).some(y=>typeof y=="string"||y instanceof String?y.toLowerCase().includes(C||""):!1))};return O.jsxs(A.Stack,{gap:2,children:[O.jsxs(A.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[O.jsx(Fle,{onSearch:C=>m(C),onChange:C=>m(C.target.value),iconPosition:"start",size:"small",placeholder:"Buscar"}),O.jsxs(A.Typography,{variant:"body1",color:"text.disabled",children:[f.length," selecionados"]})]}),O.jsx(CBn,{apiRef:s,columns:e,rows:h(),pagination:!0,paginationModel:{page:l,pageSize:d},rowCount:r,paginationMode:"server",onPaginationModelChange:u,initialState:{pagination:{paginationModel:{pageSize:5,page:l}}},loading:n,fetching:a,checkboxSelection:!0,onRowSelectionModelChange:v})]})},Rlu=zt(A.ToggleButton)(({theme:e})=>({width:"100%","&.Mui-selected":{backgroundColor:e.palette.primary.main,color:e.palette.common.white,"&:hover":{backgroundColor:e.palette.primary.main}}})),zlu=zt(A.ToggleButtonGroup)(()=>({display:"flex",justifyContent:"space-between"})),Hlu=({rules:e,setRuleType:t})=>{const[n,a]=o.useState(),{setValue:r}=Re.useFormContext();o.useEffect(()=>{if(e&&e.length>0&&(a(e[0].value),t))return t(e[0].value)},[]),o.useEffect(()=>()=>{r("config",{})},[]);const u=(c,s)=>{if(s!==null&&(a(s),t))return t(s)};return O.jsxs(A.Stack,{gap:2,children:[O.jsx(pn,{name:"name",label:"Nome da regra",required:!0,rules:{required:{value:!0,message:"Nome da regra é obrigatório"}}}),O.jsx(A.Typography,{color:"grey.500",variant:"overline",children:"Selecione a regra"}),e&&O.jsx(zlu,{color:"primary",value:n,size:"small",exclusive:!0,onChange:u,children:e.map((c,s)=>O.jsx(Rlu,{value:c.value,size:"small",color:"primary",children:O.jsx(A.Typography,{variant:"body2",children:c.toggleTitle})},s))}),e&&e.map((c,s)=>c.value===n?O.jsx("div",{children:c.component},s):null)]})},Vlu=A.styled(A.ToggleButtonGroup)(({theme:e})=>({button:{textTransform:"none"},"& .MuiToggleButton-primary:hover":{backgroundColor:`${e.palette.primary.dark}`,color:e.palette.primary.contrastText},"& button:not(.Mui-selected):hover":{backgroundColor:e.palette.primary.lighter,color:e.palette.primary.main},"& .Mui-selected":{backgroundColor:`${e.palette.primary.main} !important`,color:`${e.palette.primary.contrastText} !important`}})),sYn=e=>O.jsx(Vlu,{...e});var fYn={exports:{}};(function(e,t){(function(){var n="ace",a=function(){return this}();!a&&typeof window<"u"&&(a=window);var r=function(f,g,_){if(typeof f!="string"){r.original?r.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(_=g),r.modules[f]||(r.payloads[f]=_,r.modules[f]=null)};r.modules={},r.payloads={};var u=function(f,g,_){if(typeof g=="string"){var m=l(f,g);if(m!=null)return _&&_(),m}else if(Object.prototype.toString.call(g)==="[object Array]"){for(var v=[],h=0,C=g.length;h<C;++h){var p=l(f,g[h]);if(p==null&&c.original)return;v.push(p)}return _&&_.apply(null,v)||!0}},c=function(f,g){var _=u("",f,g);return _==null&&c.original?c.original.apply(this,arguments):_},s=function(f,g){if(g.indexOf("!")!==-1){var _=g.split("!");return s(f,_[0])+"!"+s(f,_[1])}if(g.charAt(0)=="."){var m=f.split("/").slice(0,-1).join("/");for(g=m+"/"+g;g.indexOf(".")!==-1&&v!=g;){var v=g;g=g.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return g},l=function(f,g){g=s(f,g);var _=r.modules[g];if(!_){if(_=r.payloads[g],typeof _=="function"){var m={},v={id:g,uri:"",exports:m,packaged:!0},h=function(p,y){return u(g,p,y)},C=_(h,m,v);m=C||v.exports,r.modules[g]=m,delete r.payloads[g]}_=r.modules[g]=m||_}return _};function d(f){var g=a;f&&(a[f]||(a[f]={}),g=a[f]),(!g.define||!g.define.packaged)&&(r.original=g.define,g.define=r,g.define.packaged=!0),(!g.require||!g.require.packaged)&&(c.original=g.require,g.require=c,g.require.packaged=!0)}d(n)})(),ace.define("ace/lib/es6-shim",["require","exports","module"],function(n,a,r){function u(c,s,l){Object.defineProperty(c,s,{value:l,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||u(String.prototype,"startsWith",function(c,s){return s=s||0,this.lastIndexOf(c,s)===s}),String.prototype.endsWith||u(String.prototype,"endsWith",function(c,s){var l=this;(s===void 0||s>l.length)&&(s=l.length),s-=c.length;var d=l.indexOf(c,s);return d!==-1&&d===s}),String.prototype.repeat||u(String.prototype,"repeat",function(c){for(var s="",l=this;c>0;)c&1&&(s+=l),(c>>=1)&&(l+=l);return s}),String.prototype.includes||u(String.prototype,"includes",function(c,s){return this.indexOf(c,s)!=-1}),Object.assign||(Object.assign=function(c){if(c==null)throw new TypeError("Cannot convert undefined or null to object");for(var s=Object(c),l=1;l<arguments.length;l++){var d=arguments[l];d!=null&&Object.keys(d).forEach(function(f){s[f]=d[f]})}return s}),Object.values||(Object.values=function(c){return Object.keys(c).map(function(s){return c[s]})}),Array.prototype.find||u(Array.prototype,"find",function(c){for(var s=this.length,l=arguments[1],d=0;d<s;d++){var f=this[d];if(c.call(l,f,d,this))return f}}),Array.prototype.findIndex||u(Array.prototype,"findIndex",function(c){for(var s=this.length,l=arguments[1],d=0;d<s;d++){var f=this[d];if(c.call(l,f,d,this))return d}}),Array.prototype.includes||u(Array.prototype,"includes",function(c,s){return this.indexOf(c,s)!=-1}),Array.prototype.fill||u(Array.prototype,"fill",function(c){for(var s=this,l=s.length>>>0,d=arguments[1],f=d>>0,g=f<0?Math.max(l+f,0):Math.min(f,l),_=arguments[2],m=_===void 0?l:_>>0,v=m<0?Math.max(l+m,0):Math.min(m,l);g<v;)s[g]=c,g++;return s}),Array.of||u(Array,"of",function(){return Array.prototype.slice.call(arguments)})}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(n,a,r){n("./es6-shim")}),ace.define("ace/lib/deep_copy",["require","exports","module"],function(n,a,r){a.deepCopy=function u(c){if(typeof c!="object"||!c)return c;var s;if(Array.isArray(c)){s=[];for(var l=0;l<c.length;l++)s[l]=u(c[l]);return s}if(Object.prototype.toString.call(c)!=="[object Object]")return c;s={};for(var l in c)s[l]=u(c[l]);return s}}),ace.define("ace/lib/lang",["require","exports","module","ace/lib/deep_copy"],function(n,a,r){a.last=function(s){return s[s.length-1]},a.stringReverse=function(s){return s.split("").reverse().join("")},a.stringRepeat=function(s,l){for(var d="";l>0;)l&1&&(d+=s),(l>>=1)&&(s+=s);return d};var u=/^\s\s*/,c=/\s\s*$/;a.stringTrimLeft=function(s){return s.replace(u,"")},a.stringTrimRight=function(s){return s.replace(c,"")},a.copyObject=function(s){var l={};for(var d in s)l[d]=s[d];return l},a.copyArray=function(s){for(var l=[],d=0,f=s.length;d<f;d++)s[d]&&typeof s[d]=="object"?l[d]=this.copyObject(s[d]):l[d]=s[d];return l},a.deepCopy=n("./deep_copy").deepCopy,a.arrayToMap=function(s){for(var l={},d=0;d<s.length;d++)l[s[d]]=1;return l},a.createMap=function(s){var l=Object.create(null);for(var d in s)l[d]=s[d];return l},a.arrayRemove=function(s,l){for(var d=0;d<=s.length;d++)l===s[d]&&s.splice(d,1)},a.escapeRegExp=function(s){return s.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},a.escapeHTML=function(s){return(""+s).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},a.getMatchOffsets=function(s,l){var d=[];return s.replace(l,function(f){d.push({offset:arguments[arguments.length-2],length:f.length})}),d},a.deferredCall=function(s){var l=null,d=function(){l=null,s()},f=function(g){return f.cancel(),l=setTimeout(d,g||0),f};return f.schedule=f,f.call=function(){return this.cancel(),s(),f},f.cancel=function(){return clearTimeout(l),l=null,f},f.isPending=function(){return l},f},a.delayedCall=function(s,l){var d=null,f=function(){d=null,s()},g=function(_){d==null&&(d=setTimeout(f,_||l))};return g.delay=function(_){d&&clearTimeout(d),d=setTimeout(f,_||l)},g.schedule=g,g.call=function(){this.cancel(),s()},g.cancel=function(){d&&clearTimeout(d),d=null},g.isPending=function(){return d},g},a.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch{return!1}return!0},a.skipEmptyMatch=function(s,l,d){return d&&s.codePointAt(l)>65535?2:1}}),ace.define("ace/lib/useragent",["require","exports","module"],function(n,a,r){a.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},a.getOS=function(){return a.isMac?a.OS.MAC:a.isLinux?a.OS.LINUX:a.OS.WINDOWS};var u=typeof navigator=="object"?navigator:{},c=(/mac|win|linux/i.exec(u.platform)||["other"])[0].toLowerCase(),s=u.userAgent||"",l=u.appName||"";a.isWin=c=="win",a.isMac=c=="mac",a.isLinux=c=="linux",a.isIE=l=="Microsoft Internet Explorer"||l.indexOf("MSAppHost")>=0?parseFloat((s.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((s.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),a.isOldIE=a.isIE&&a.isIE<9,a.isGecko=a.isMozilla=s.match(/ Gecko\/\d+/),a.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",a.isWebKit=parseFloat(s.split("WebKit/")[1])||void 0,a.isChrome=parseFloat(s.split(" Chrome/")[1])||void 0,a.isSafari=parseFloat(s.split(" Safari/")[1])&&!a.isChrome||void 0,a.isEdge=parseFloat(s.split(" Edge/")[1])||void 0,a.isAIR=s.indexOf("AdobeAIR")>=0,a.isAndroid=s.indexOf("Android")>=0,a.isChromeOS=s.indexOf(" CrOS ")>=0,a.isIOS=/iPad|iPhone|iPod/.test(s)&&!window.MSStream,a.isIOS&&(a.isMac=!0),a.isMobile=a.isIOS||a.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(n,a,r){var u=n("./useragent"),c="http://www.w3.org/1999/xhtml";a.buildDom=function _(m,v,h){if(typeof m=="string"&&m){var C=document.createTextNode(m);return v&&v.appendChild(C),C}if(!Array.isArray(m))return m&&m.appendChild&&v&&v.appendChild(m),m;if(typeof m[0]!="string"||!m[0]){for(var p=[],y=0;y<m.length;y++){var S=_(m[y],v,h);S&&p.push(S)}return p}var w=document.createElement(m[0]),j=m[1],b=1;j&&typeof j=="object"&&!Array.isArray(j)&&(b=2);for(var y=b;y<m.length;y++)_(m[y],w,h);return b==2&&Object.keys(j).forEach(function(M){var P=j[M];M==="class"?w.className=Array.isArray(P)?P.join(" "):P:typeof P=="function"||M=="value"||M[0]=="$"?w[M]=P:M==="ref"?h&&(h[P]=w):M==="style"?typeof P=="string"&&(w.style.cssText=P):P!=null&&w.setAttribute(M,P)}),v&&v.appendChild(w),w},a.getDocumentHead=function(_){return _||(_=document),_.head||_.getElementsByTagName("head")[0]||_.documentElement},a.createElement=function(_,m){return document.createElementNS?document.createElementNS(m||c,_):document.createElement(_)},a.removeChildren=function(_){_.innerHTML=""},a.createTextNode=function(_,m){var v=m?m.ownerDocument:document;return v.createTextNode(_)},a.createFragment=function(_){var m=_?_.ownerDocument:document;return m.createDocumentFragment()},a.hasCssClass=function(_,m){var v=(_.className+"").split(/\s+/g);return v.indexOf(m)!==-1},a.addCssClass=function(_,m){a.hasCssClass(_,m)||(_.className+=" "+m)},a.removeCssClass=function(_,m){for(var v=_.className.split(/\s+/g);;){var h=v.indexOf(m);if(h==-1)break;v.splice(h,1)}_.className=v.join(" ")},a.toggleCssClass=function(_,m){for(var v=_.className.split(/\s+/g),h=!0;;){var C=v.indexOf(m);if(C==-1)break;h=!1,v.splice(C,1)}return h&&v.push(m),_.className=v.join(" "),h},a.setCssClass=function(_,m,v){v?a.addCssClass(_,m):a.removeCssClass(_,m)},a.hasCssString=function(_,m){var v=0,h;if(m=m||document,h=m.querySelectorAll("style")){for(;v<h.length;)if(h[v++].id===_)return!0}},a.removeElementById=function(_,m){m=m||document,m.getElementById(_)&&m.getElementById(_).remove()};var s,l=[];a.useStrictCSP=function(_){s=_,_==!1?d():l||(l=[])};function d(){var _=l;l=null,_&&_.forEach(function(m){f(m[0],m[1])})}function f(_,m,v){if(!(typeof document>"u")){if(l){if(v)d();else if(v===!1)return l.push([_,m])}if(!s){var h=v;!v||!v.getRootNode?h=document:(h=v.getRootNode(),(!h||h==v)&&(h=document));var C=h.ownerDocument||h;if(m&&a.hasCssString(m,h))return null;m&&(_+=`
35410
35410
  /*# sourceURL=ace/css/`+m+" */");var p=a.createElement("style");p.appendChild(C.createTextNode(_)),m&&(p.id=m),h==C&&(h=a.getDocumentHead(C)),h.insertBefore(p,h.firstChild)}}}if(a.importCssString=f,a.importCssStylsheet=function(_,m){a.buildDom(["link",{rel:"stylesheet",href:_}],a.getDocumentHead(m))},a.scrollbarWidth=function(_){var m=a.createElement("ace_inner");m.style.width="100%",m.style.minWidth="0px",m.style.height="200px",m.style.display="block";var v=a.createElement("ace_outer"),h=v.style;h.position="absolute",h.left="-10000px",h.overflow="hidden",h.width="200px",h.minWidth="0px",h.height="150px",h.display="block",v.appendChild(m);var C=_&&_.documentElement||document&&document.documentElement;if(!C)return 0;C.appendChild(v);var p=m.offsetWidth;h.overflow="scroll";var y=m.offsetWidth;return p===y&&(y=v.clientWidth),C.removeChild(v),p-y},a.computedStyle=function(_,m){return window.getComputedStyle(_,"")||{}},a.setStyle=function(_,m,v){_[m]!==v&&(_[m]=v)},a.HAS_CSS_ANIMATION=!1,a.HAS_CSS_TRANSFORMS=!1,a.HI_DPI=u.isWin?typeof window<"u"&&window.devicePixelRatio>=1.5:!0,u.isChromeOS&&(a.HI_DPI=!1),typeof document<"u"){var g=document.createElement("div");a.HI_DPI&&g.style.transform!==void 0&&(a.HAS_CSS_TRANSFORMS=!0),!u.isEdge&&typeof g.style.animationName<"u"&&(a.HAS_CSS_ANIMATION=!0),g=null}a.HAS_CSS_TRANSFORMS?a.translate=function(_,m,v){_.style.transform="translate("+Math.round(m)+"px, "+Math.round(v)+"px)"}:a.translate=function(_,m,v){_.style.top=Math.round(v)+"px",_.style.left=Math.round(m)+"px"}}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(n,a,r){/*
35411
35411
  * based on code from:
35412
35412
  *
@@ -36628,4 +36628,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
36628
36628
  `&&(u.left++,d--),_=d,_===0&&r.right.push({startLine:u.right,endLine:u.right}),g===`
36629
36629
  `&&(_-=1),r.left.push({startLine:u.left,endLine:u.left+_}),u.left+=d;break;case a.DIFF_INSERT:f===`
36630
36630
  `&&(u.right++,d--),_=d,_===0&&r.left.push({startLine:u.left,endLine:u.left}),g===`
36631
- `&&(_-=1),r.right.push({startLine:u.right,endLine:u.right+_}),u.right+=d;break;default:throw new Error("Diff type was not defined.")}}}),r},t.prototype.setCodeMarkers=function(n){n===void 0&&(n={left:[],right:[]});for(var a=[],r={left:[],right:[]},u=0;u<n.left.length;u++){var c={startRow:n.left[u].startLine-1,endRow:n.left[u].endLine,type:"text",className:"codeMarker"};r.left.push(c)}for(var u=0;u<n.right.length;u++){var c={startRow:n.right[u].startLine-1,endRow:n.right[u].endLine,type:"text",className:"codeMarker"};r.right.push(c)}return a[0]=r.left,a[1]=r.right,a},t.prototype.render=function(){var n=this.diff();return SYn.createElement(n5u.default,{name:this.props.name,className:this.props.className,focus:this.props.focus,orientation:this.props.orientation,splits:this.props.splits,mode:this.props.mode,theme:this.props.theme,height:this.props.height,width:this.props.width,fontSize:this.props.fontSize,showGutter:this.props.showGutter,onChange:this.onChange,onPaste:this.props.onPaste,onLoad:this.props.onLoad,onScroll:this.props.onScroll,minLines:this.props.minLines,maxLines:this.props.maxLines,readOnly:this.props.readOnly,highlightActiveLine:this.props.highlightActiveLine,showPrintMargin:this.props.showPrintMargin,tabSize:this.props.tabSize,cursorStart:this.props.cursorStart,editorProps:this.props.editorProps,style:this.props.style,scrollMargin:this.props.scrollMargin,setOptions:this.props.setOptions,wrapEnabled:this.props.wrapEnabled,enableBasicAutocompletion:this.props.enableBasicAutocompletion,enableLiveAutocompletion:this.props.enableLiveAutocompletion,value:this.state.value,markers:n})},t.propTypes={cursorStart:Mt.number,editorProps:Mt.object,enableBasicAutocompletion:Mt.bool,enableLiveAutocompletion:Mt.bool,focus:Mt.bool,fontSize:Mt.number,height:Mt.string,highlightActiveLine:Mt.bool,maxLines:Mt.number,minLines:Mt.number,mode:Mt.string,name:Mt.string,className:Mt.string,onLoad:Mt.func,onPaste:Mt.func,onScroll:Mt.func,onChange:Mt.func,orientation:Mt.string,readOnly:Mt.bool,scrollMargin:Mt.array,setOptions:Mt.object,showGutter:Mt.bool,showPrintMargin:Mt.bool,splits:Mt.number,style:Mt.object,tabSize:Mt.number,theme:Mt.string,value:Mt.array,width:Mt.string,wrapEnabled:Mt.bool},t.defaultProps={cursorStart:1,editorProps:{},enableBasicAutocompletion:!1,enableLiveAutocompletion:!1,focus:!1,fontSize:12,height:"500px",highlightActiveLine:!0,maxLines:null,minLines:null,mode:"",name:"ace-editor",onLoad:null,onScroll:null,onPaste:null,onChange:null,orientation:"beside",readOnly:!1,scrollMargin:[0,0,0,0],setOptions:{},showGutter:!0,showPrintMargin:!0,splits:2,style:{},tabSize:4,theme:"github",value:["",""],width:"500px",wrapEnabled:!0},t}(SYn.Component);jWn.default=a5u,Object.defineProperty(Zle,"__esModule",{value:!0}),Zle.diff=Zle.split=void 0;var i5u=pWn,o5u=jWn;Zle.diff=o5u.default;var u5u=Qbt;Zle.split=u5u.default;var c5u=Zle.default=i5u.default;const DYn=A.styled(A.Stack)(({theme:e})=>({borderBottom:`1px solid ${A.alpha(e.palette.grey[500],.32)}`,borderTop:`1px solid ${A.alpha(e.palette.grey[500],.32)}`,padding:16})),l5u=A.styled(A.Stack)(({theme:e})=>({border:`1px solid ${A.alpha(e.palette.grey[500],.32)}`,borderRadius:8,padding:12,"& .MuiInputBase-root":{background:e.palette.grey[100]}})),s5u=A.styled(A.Stack)(({theme:e})=>({display:"flex",textAlign:"center",flexDirection:"row",alignItems:"center",width:"100%",gap:8,height:34,backgroundColor:"#fff",padding:"8px 16px",borderRadius:8,border:`1px solid ${A.alpha(e.palette.grey[500],.24)}`,cursor:"pointer",color:e.palette.text.disabled,"&:hover, &:focus":{border:`1px solid ${e.palette.primary.main}`,backgroundColor:A.alpha(e.palette.primary.main,.05)}})),f5u=A.styled(A.Stack)(({theme:e})=>({width:"100%","& fieldset":{border:`1px solid ${A.alpha(e.palette.grey[500],.24)}`,borderRadius:8,"& legend":{color:e.palette.text.disabled,fontSize:12}}})),IYn=A.styled(A.IconButton)({marginLeft:"auto",padding:0}),d5u=({openPopover:e,handleClose:t,addItem:n})=>{const[a,r]=o.useState(""),u=()=>{n(a),t(),r("")};return O.jsxs(A.Popover,{open:!!e,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:e,onClose:t,sx:{maxWidth:464},title:"Novo Argumento",children:[O.jsx(A.Typography,{variant:"subtitle1",color:"text.primary",p:1,children:"Novo Argumento"}),O.jsx(DYn,{children:O.jsx(A.TextField,{value:a,onChange:c=>r(c.target.value),name:"item",label:"Novo argumento",size:"small"})}),O.jsxs(A.Stack,{p:1,direction:"row",justifyContent:"flex-end",spacing:1,children:[O.jsx(A.Button,{variant:"outlined",color:"inherit",size:"small",onClick:t,children:"Cancelar"}),O.jsx(A.Button,{variant:"contained",color:"primary",size:"small",startIcon:O.jsx(we,{icon:"SAVE_MARK"}),disabled:!a||a==="",onClick:u,children:"Salvar"})]})]})},eyt=({label:e,itens:t,argumentsValues:n,fields:a,addItem:r,removeItem:u,insertItemSQL:c})=>{const[s,l]=o.useState(!1),d=Amt(),f=()=>{l(!s)},g=(m,v)=>{m.stopPropagation(),u&&u(v)},_=m=>{c(n?` $ARG[${m}]`:a?` this.${m}`:` ${m}`)};return O.jsxs(A.Stack,{children:[O.jsxs(A.Stack,{direction:"row",alignItems:"center",spacing:1.5,padding:1,paddingLeft:0,children:[O.jsx(IYn,{edge:"end",onClick:f,children:O.jsx(we,{icon:s?"CHEVRON_UP":"CHEVRON_RIGHT"})}),O.jsx(A.Typography,{variant:"overline",color:"text.primary",children:e}),r&&O.jsxs(O.Fragment,{children:[O.jsx(IYn,{edge:"end",onClick:d.onOpen,children:O.jsx(we,{icon:"SIMPLE_ADD"})}),O.jsx(d5u,{addItem:r,handleClose:d.onClose,openPopover:d.open})]})]}),s&&O.jsx(A.Stack,{spacing:.5,children:O.jsx(ZT,{sx:{maxHeight:150},children:t==null?void 0:t.map((m,v)=>O.jsxs(s5u,{direction:"row",justifyContent:"space-between",onClick:()=>_(m),children:[O.jsx(A.Typography,{variant:"caption",textAlign:"center",width:"100%",children:m}),u&&O.jsx(A.IconButton,{edge:"end",onClick:h=>g(h,m),children:O.jsx(we,{icon:"DELETE_MARK_BUTTON_02"})})]},v))})})]})},g5u=({fieldsSelect:e,argumentsValues:t,onChangeArguments:n,sql:a,setSql:r,setFilterRule:u})=>{const[c,s]=o.useState(),{setValue:l}=Re.useFormContext(),[d,f]=o.useState(1),[g,_]=o.useState(),m=y=>{g.session.insert(d,` ${y} `)},v=y=>{n([...t||[],y])},h=y=>{n(t==null?void 0:t.filter(S=>S!==y))},C=y=>{r(y),u(y),l("groups",void 0)},p=c?e.filter(y=>{var S;return y.id.toString().toLocaleLowerCase().includes(c)||y.description.toString().toLocaleLowerCase().includes(c)||((S=y.name)==null?void 0:S.toString().toLocaleLowerCase().includes(c))}):e;return O.jsxs(A.Stack,{direction:"row",padding:1.5,spacing:1.5,children:[O.jsxs(l5u,{children:[O.jsx(Fle,{value:c,trigger:"change",onSearch:y=>s(y==null?void 0:y.toLocaleLowerCase()),fullWidth:!0,size:"small",placeholder:"Buscar",iconPosition:"start"}),O.jsx(eyt,{label:"Campos",fields:!0,itens:p.map(y=>y.name),insertItemSQL:m}),O.jsx(eyt,{label:"Argumentos",argumentsValues:!0,itens:t,addItem:v,removeItem:h,insertItemSQL:m}),O.jsx(eyt,{label:"Operadores",insertItemSQL:m,itens:["=",">","<","<=",">=","!=","IS NULL","IN","LIKE","NOT IN","NOT LIKE","IS NOT NULL"]}),O.jsx(eyt,{label:"Filtros",fields:!0,insertItemSQL:m,itens:p.map(y=>y.name)})]}),O.jsx(f5u,{children:O.jsxs("fieldset",{children:[O.jsx("legend",{children:"Regras de listagem"}),O.jsx(c5u,{width:"100%",mode:"sql",theme:"chrome",name:"rule",fontSize:14,onChange:C,onCursorChange:y=>f(y.getCursor()),value:a,onLoad:y=>_(y),showPrintMargin:!1,showGutter:!1,highlightActiveLine:!1,setOptions:{enableBasicAutocompletion:!0,enableLiveAutocompletion:!0,enableSnippets:!0,showLineNumbers:!1,tabSize:2}})]})})]})},_5u=({data:e,fields:t,isLoading:n,isError:a})=>O.jsxs(A.Stack,{children:[O.jsx(A.Typography,{variant:"subtitle2",color:"text.secondary",children:"PRÉ VISUALIZAÇÃO DOS RESULTADOS DA LISTAGEM"}),a&&O.jsx(A.Stack,{children:"Falha ao gerar resultado"}),e&&O.jsx(CBn,{columns:t==null?void 0:t.map(r=>({field:r,headerName:r,width:150,type:"string"})),loading:n,rows:e,disableRowSelectionOnClick:!0,disableColumnMenu:!0,disableColumnResize:!0,showColumnVerticalBorder:!0,hideFooter:!0})]}),m5u=({openPopover:e,handleClose:t,argumentsValues:n,filter:a,onExecute:r})=>{const[u,c]=o.useState([]),s=(d,f)=>{if(f&&f!=="")u.filter(_=>_.name===d).length>0?c(u.map(_=>_.name===d?{name:d,value:f}:_)):c([...u||[],{name:d,value:f}]);else{const g=u.filter(_=>_.name===d);c(g)}},l=()=>{let d=a||"";return u.forEach(f=>{d=d.replace(`$ARG[${f.name}]`,`'${f.value}'`)}),d};return O.jsxs(A.Popover,{open:!!e,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:e,onClose:t,title:"Pré-visualizar",children:[O.jsx(A.Typography,{variant:"subtitle1",color:"text.primary",p:1,children:"Pré-visualizar"}),O.jsx(DYn,{children:n==null?void 0:n.map((d,f)=>O.jsx(A.TextField,{name:d,label:d,size:"small",onChange:g=>s(d,g.target.value),required:!0},f))}),O.jsxs(A.Stack,{p:2,direction:"row",justifyContent:"flex-end",spacing:1,children:[O.jsx(A.Button,{variant:"outlined",color:"inherit",size:"small",onClick:t,children:"Cancelar"}),O.jsx(A.Button,{variant:"contained",color:"primary",size:"small",startIcon:O.jsx(we,{icon:"PLAY_SIMPLE"}),onClick:()=>r(l()),disabled:u.length<n.length,children:"Executar"})]})]})},v5u=A.styled(A.Stack)(({theme:e})=>({border:`1px solid ${A.alpha(e.palette.grey[500],.32)}`,borderRadius:8,alignItems:"center",overflow:"hidden"})),h5u=A.styled(A.Stack)(()=>({backgroundColor:"#F5F5F5",padding:8,width:"100%",justifyContent:"space-between",alignItems:"center",gap:12,"& .MuiInputBase-root":{backgroundColor:"#fff"}}));A.styled(A.Stack)(({theme:e})=>({border:`1px solid ${A.alpha(e.palette.grey[500],.32)}`,borderRadius:8,alignItems:"center"}));const C5u=A.styled(A.Collapse)(()=>({width:"100%",padding:"12px 16px"})),BYn=({description:e,name:t,children:n,header:a,onDelete:r})=>{const[u,c]=xmt(!0);return O.jsxs(v5u,{children:[O.jsxs(h5u,{direction:"row",children:[O.jsxs(A.Stack,{direction:"row",alignItems:"center",gap:1.5,flex:1,children:[O.jsx(A.IconButton,{edge:"end",onClick:c,children:O.jsx(we,{icon:u?"CHEVRON_UP":"CHEVRON_RIGHT"})}),O.jsx(A.Typography,{variant:"overline",color:"text.primary",children:t}),O.jsx(A.Typography,{variant:"overline",color:"text.secondary",children:e}),O.jsx(A.Stack,{flex:1,children:a})]}),O.jsx(A.IconButton,{color:"error",onClick:r,children:O.jsx(we,{icon:"DELETE_MARK_BUTTON_02"})})]}),O.jsx(C5u,{in:u,timeout:"auto",unmountOnExit:!0,children:n})]})},oZ=({name:e,helperText:t,rules:n,onSelectOption:a,...r})=>{const{control:u}=Re.useFormContext();return O.jsx(Re.Controller,{name:e,control:u,rules:n,render:({field:c,fieldState:{error:s}})=>O.jsx(BDn,{...c,...r,onChange:l=>{a&&a(l,c.value),c.onChange(l)},error:!!s,helperText:(s==null?void 0:s.message)||t})})},pn=({name:e,helperText:t,rules:n,onChange:a,tabIndex:r,...u})=>{const{control:c}=Re.useFormContext();return O.jsx(Re.Controller,{name:e,control:c,rules:n,render:({field:{ref:s,...l},fieldState:{error:d}})=>O.jsx(A.TextField,{...l,onChange:f=>{l.onChange(f),a&&a(f)},inputRef:s,fullWidth:!0,error:!!d,helperText:(d==null?void 0:d.message)||t,...u,inputProps:{...u.inputProps,tabIndex:r}})})},b5u=A.styled(A.Stack)(({theme:e})=>({border:`1px solid ${A.alpha(e.palette.primary.main,.32)}`,backgroundColor:A.alpha(e.palette.primary.main,.08),borderRadius:8,padding:8,paddingLeft:24,alignItems:"center"})),y5u=A.styled(A.IconButton)(()=>({height:"28px",marginLeft:"16px","&:hover":{backgroundColor:"transparent"}})),WYn=A.styled(oZ)(()=>({width:230})),p5u=({index:e,indexGroup:t,removeConditional:n,fieldsSelect:a})=>{const{watch:r}=Re.useFormContext(),u=`groups.[${t}].conditionals[${e}].field`,c=`groups.[${t}].conditionals[${e}].conditional`,s=`groups.[${t}].conditionals[${e}].type`,l=`groups.[${t}].conditionals[${e}].value`,d=[{value:"=",label:"Igual a"},{value:">",label:"Maior que"},{value:"<",label:"Menor que"},{value:"<=",label:"Menor ou igual a"},{value:">=",label:"Maior ou igual a"},{value:"!=",label:"Diferente de"},{value:"IS NULL",label:"Está vazio"},{value:"IN",label:"Contido em"},{value:"LIKE",label:"Contendo"},{value:"NOT IN",label:"Não contido em"},{value:"NOT LIKE",label:"Não contém"},{value:"IS NOT NULL",label:"Não está vazio"}],f=r(s);return O.jsxs(A.Stack,{direction:"row",spacing:1.5,alignItems:"center",width:1,children:[O.jsx(oZ,{label:"Se",name:u,size:"small",fullWidth:!0,options:a==null?void 0:a.map(g=>({value:g.name,label:g.description}))}),O.jsx(oZ,{label:"Estado",name:c,size:"small",fullWidth:!0,options:d}),O.jsx(oZ,{label:"Objetivo",name:`groups.[${t}].conditionals[${e}].type`,size:"small",fullWidth:!0,options:[{label:"Valor",value:"value"},{label:"Campo",value:"field"}]}),f==="value"?O.jsx(pn,{label:"Valor",name:l,size:"small",fullWidth:!0}):O.jsx(oZ,{label:"Se",name:l,size:"small",fullWidth:!0,options:a==null?void 0:a.map(g=>({value:g.name,label:g.description}))}),O.jsx(y5u,{color:"error",onClick:()=>{n(e)},children:O.jsx(we,{icon:"DELETE_MARK_BUTTON_02"})})]})},O5u=({index:e,removeGroup:t,fieldsSelect:n})=>{const{control:a}=Re.useFormContext(),r=`groups.[${e}].operator`,{fields:u,append:c,remove:s}=Re.useFieldArray({name:`groups.${e}.conditionals`,control:a});return O.jsx(BYn,{name:`GRUPO ${e+1}`,description:"EXIBIR A LISTAGEM QUANDO ATENDER UMA DAS CONDIÇÕES",header:O.jsx(WYn,{name:r,size:"small",options:[{label:"Qualquer",value:"or"},{label:"Todas as condições",value:"and"}]}),onDelete:()=>t(e),children:O.jsxs(A.Stack,{spacing:1.5,alignItems:"flex-start",children:[u.map((l,d)=>O.jsx(p5u,{index:d,indexGroup:e,removeConditional:f=>s(f),fieldsSelect:n},l.id)),O.jsx(EDn,{actionType:"NEW",onClick:()=>c({field:"",conditional:"=",type:"value",value:""}),variant:"text",size:"small",children:"Adicionar condição"})]})})},j5u=({fieldsSelect:e})=>{const{control:t}=Re.useFormContext(),{fields:n,append:a,remove:r}=Re.useFieldArray({name:"groups",control:t});return O.jsxs(A.Stack,{gap:1.5,children:[O.jsxs(b5u,{direction:"row",spacing:1.5,children:[O.jsx(A.Typography,{variant:"body2",color:"text.light.primary",children:"Se"}),O.jsx(A.Stack,{children:O.jsx(WYn,{size:"small",name:"operator",options:[{label:"Qualquer",value:"or"},{label:"Todas as condições",value:"and"}]})}),O.jsxs(A.Typography,{variant:"body2",color:"text.light.primary",children:["regra de ",O.jsx("strong",{children:"todos os grupos"})," “Se” forem cumpridas,"," ",O.jsx("strong",{children:"irá exibir a listagem."})]})]}),n.map((u,c)=>O.jsx(O5u,{index:c,removeGroup:s=>r(s),fieldsSelect:e},u.id)),O.jsx(A.Button,{size:"large",color:"inherit",startIcon:O.jsx(we,{icon:"SIMPLE_ADD"}),variant:"outlined",fullWidth:!0,onClick:()=>{a({operator:"or",conditionals:[{field:"",conditional:"=",type:"value",value:""}]})},children:"Adicionar grupo"})]})},w5u=A.styled(A.Stack)(({theme:e})=>({border:`1px solid ${A.alpha(e.palette.grey[500],.32)}`,borderRadius:8,marginTop:24})),M5u=A.styled(A.Stack)(()=>({padding:12,borderBottom:"1px solid #e0e0e0"})),$Yn=A.styled(A.ToggleButton)(()=>({lineHeight:"1em"})),L5u=A.styled(A.Stack)(()=>({padding:12})),P5u=({argumentsValues:e,onChangeArguments:t,fieldsSelect:n,onChangeRule:a,onChangeSqlProcessed:r,defaultMode:u,defaultFilter:c,dataPreview:s,errorPreview:l,loadingPreview:d})=>{const[f,g]=o.useState(c||""),[_,m]=xmt(),[v,h]=o.useState(u||"simple"),{watch:C,setValue:p}=Re.useFormContext(),y=Amt(),S=C("operator"),w=C("groups");o.useEffect(()=>()=>{p("config",{})},[]);const j=(P,k)=>{if(k==="advanced"){const W=EKn(w,S);g(W),r(W),a(W)}h(k)},b=P=>{_||v==="simple"||e.length===0?m():y.onOpen(P)},M=P=>{m(),r(P)};return O.jsx(O.Fragment,{children:O.jsxs(w5u,{children:[O.jsxs(M5u,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[O.jsxs(sYn,{color:"primary",value:v,size:"small",exclusive:!0,onChange:j,children:[O.jsx($Yn,{value:"simple",size:"small",children:"Modo simplificado"}),O.jsx($Yn,{value:"advanced",size:"small",children:"Modo avançado"})]}),O.jsx(A.Button,{variant:"outlined",color:"inherit",onClick:P=>b(P),startIcon:!_&&O.jsx(we,{icon:"PLAY_SIMPLE",color:"primary.main"}),children:_?"Voltar":"Executar"}),!!y.open&&O.jsx(m5u,{handleClose:y.onClose,openPopover:y.open,argumentsValues:e,filter:f,onExecute:P=>M(P)})]}),O.jsx(L5u,{children:_?O.jsx(_5u,{fields:n.map(P=>P.name),data:s,isError:l,isLoading:d}):O.jsx(O.Fragment,{children:v==="simple"?O.jsx(j5u,{fieldsSelect:n,sql:f,setSql:g}):O.jsx(g5u,{fieldsSelect:n,argumentsValues:e,onChangeArguments:t,sql:f,setSql:g,setFilterRule:a})})})]})})},xYn=({name:e,helperText:t,onChange:n,tabIndex:a,...r})=>{const{control:u}=Re.useFormContext();return O.jsx(Re.Controller,{name:e,control:u,render:({field:c,fieldState:{error:s}})=>O.jsxs("div",{children:[O.jsx(A.FormControlLabel,{control:O.jsx(A.Switch,{...c,checked:c.value,onChange:(l,d)=>{c.onChange(l),n&&n(l,d)},inputProps:{tabIndex:a}}),...r}),(!!s||t)&&O.jsx(A.FormHelperText,{error:!!s,sx:l=>({mx:"14px",color:r.disabled?l.palette.grey[500]:void 0}),children:s?s==null?void 0:s.message:t})]})})},E5u=[{label:"JSON",value:"JSON"},{label:"XML",value:"XML"},{label:"BINÁRIO",value:"BYTEA"}],k5u=[{label:"PUT",value:"PUT"},{label:"POST",value:"POST"},{label:"GET",value:"GET"},{label:"DELETE",value:"DELETE"}],S5u=A.styled(A.Stack)(({theme:e})=>({border:`1px solid ${A.alpha(e.palette.primary.main,.3)}`,backgroundColor:A.alpha(e.palette.primary.main,.05),flexDirection:"row",alignItems:"center",padding:10,gap:10,borderRadius:8,marginBottom:8,svg:{color:e.palette.primary.main}})),D5u=A.styled(A.IconButton)(({theme:e})=>({svg:{color:`${e.palette.primary.main} !important`}})),I5u=A.styled(A.IconButton)(()=>({height:"38px",alignSelf:"center"})),B5u=({webhookData:e,isEditing:t=!1,haveTip:n=!1})=>{const{control:a}=Re.useFormContext(),{fields:r,append:u,remove:c}=Re.useFieldArray({name:"headers",control:a}),s=()=>{u({value:"",name:""})};return O.jsxs(O.Fragment,{children:[n&&O.jsxs(S5u,{children:[O.jsx(we,{icon:"INFO_CIRCLE"}),O.jsx(A.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&&O.jsx(pn,{name:"name",label:"Nome do webhook"}),O.jsxs(A.Stack,{direction:"row",gap:2,children:[O.jsx(pn,{name:"url",label:"URL de endpoint",rules:{required:{value:!0,message:"Url é obrigatório"}}}),O.jsx(pn,{name:"filter",label:"Filtro"})]}),t&&e&&O.jsxs(O.Fragment,{children:[O.jsx(pn,{variant:"filled",name:"solution",label:"Solução",disabled:!0}),O.jsxs(A.Stack,{direction:"row",gap:2,children:[O.jsx(pn,{variant:"filled",name:"resource",label:"Origem",disabled:!0}),O.jsx(pn,{variant:"filled",name:"resourceID",label:"ID origem",disabled:!0,InputProps:{endAdornment:O.jsx(A.InputAdornment,{position:"end",children:O.jsx(D5u,{onClick:()=>navigator.clipboard.writeText(e.resourceID),children:O.jsx(we,{className:"copyIcon",icon:"COPY_CONTENT"})})})}}),O.jsx(pn,{variant:"filled",name:"event",label:"Evento",disabled:!0})]})]}),O.jsxs(A.Stack,{direction:"row",gap:2,children:[O.jsxs(A.Stack,{width:"35%",gap:2,children:[O.jsx(A.Typography,{color:"text.secondary",variant:"overline",children:"Tipo de conteúdo:"}),O.jsx(IWn,{name:"content_type",options:E5u,row:!0,decorated:!0})]}),O.jsxs(A.Stack,{gap:2,children:[O.jsx(A.Typography,{color:"text.secondary",variant:"overline",children:"Métodos Http:"}),O.jsx(IWn,{name:"http_method",options:k5u,row:!0,decorated:!0})]})]}),O.jsx(A.Typography,{color:"text.secondary",variant:"overline",children:"Status:"}),O.jsx(xYn,{name:"active",label:"Ativo"}),O.jsx(A.Typography,{color:"text.secondary",variant:"overline",children:"Cabeçalho:"}),r==null?void 0:r.map((l,d)=>O.jsxs(A.Stack,{direction:"row",gap:2,children:[O.jsx(pn,{name:`headers.${d}.name`,label:"Chave",rules:{required:{value:!0,message:"Chave é obrigatório"}}}),O.jsx(pn,{name:`headers.${d}.value`,label:"Valor",rules:{required:{value:!0,message:"Valor é obrigatório"}}}),O.jsx(I5u,{onClick:()=>c(d),color:"error",children:O.jsx(we,{icon:"DELETE_MARK_BUTTON_02"})})]},l.id)),O.jsx(EDn,{actionType:"NEW",size:"large",variant:"outlined",color:"inherit",fullWidth:!0,onClick:()=>s(),children:"Adicionar novo cabeçalho"}),O.jsx(A.Divider,{})]})},AYn=({name:e,helperText:t,rules:n,...a})=>{const{control:r}=Re.useFormContext();return O.jsx(Re.Controller,{name:e,control:r,rules:n,render:({field:{name:u,onChange:c,value:s,ref:l},fieldState:{error:d}})=>O.jsx(lWn,{ref:l,...a,name:u,value:s,error:!!d,helperText:(d==null?void 0:d.message)||t,onChange:({target:{value:f}})=>c(f)})})},W5u=({name:e,containerProps:t,required:n,rules:a,tabIndex:r})=>{const u=`${e}.zipCode`,c=`${e}.publicPlace`,s=`${e}.number`,l=`${e}.district`,d=`${e}.complement`,f=`${e}.state`,g=`${e}.city`,_=m=>{m.key==="Enter"&&m.preventDefault()};return O.jsxs(A.Stack,{gap:1.5,...t,children:[O.jsxs(A.Stack,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[O.jsx(AYn,{name:u,label:"CEP",mask:[{mask:"00000-000"}],InputProps:{endAdornment:O.jsx(A.InputAdornment,{position:"end",children:O.jsx(A.CircularProgress,{size:24})})},rules:a,onKeyDown:_,required:n,sx:{width:"auto",flex:1,minWidth:160},tabIndex:r}),O.jsxs(A.Stack,{direction:{xs:"column",sm:"row"},gap:1.5,flex:{xs:1,md:"1 1 50%"},children:[O.jsx(pn,{name:c,label:"Logradouro",onKeyDown:_,inputProps:{maxLength:70},sx:{width:"auto",minWidth:250,flex:1},tabIndex:r}),O.jsx(pn,{name:s,label:"Número",onKeyDown:_,inputProps:{maxLength:6},sx:{width:"auto",minWidth:100},tabIndex:r})]})]}),O.jsxs(A.Stack,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[O.jsx(pn,{name:l,label:"Bairro",onKeyDown:_,inputProps:{maxLength:20},sx:{width:"auto",flex:{xs:1,md:"1 1 100px"}},tabIndex:r}),O.jsx(pn,{name:d,label:"Complemento",onKeyDown:_,inputProps:{maxLength:30},sx:{minWidth:200,width:"auto",flex:{xs:1,md:"1 1 500px"}},tabIndex:r})]}),O.jsxs(A.Stack,{gap:1.5,flexWrap:"wrap",direction:{xs:"column",sm:"row"},children:[O.jsx(oZ,{name:f,label:"Estado",options:[],disabled:!0,required:n,sx:{flex:1},tabIndex:r}),O.jsx(pn,{name:g,label:"Cidade",disabled:!0,required:n,sx:{flex:1},tabIndex:r})]})]})},$5u=({name:e,rules:t,helperText:n,...a})=>{const{control:r}=Re.useFormContext();return O.jsx(Re.Controller,{name:e,control:r,rules:t,render:({field:u,fieldState:{error:c}})=>O.jsx($Dn,{...u,...a,onChange:s=>{u.onChange(s)},error:!!c,helperText:(c==null?void 0:c.message)||n})})},x5u=({name:e,rules:t,helperText:n,tabIndex:a,...r})=>{const{control:u}=Re.useFormContext();return O.jsx(Re.Controller,{name:e,control:u,rules:t,render:({field:c,fieldState:{error:s}})=>O.jsxs("div",{children:[O.jsx(A.FormControlLabel,{control:O.jsx(A.Checkbox,{...c,checked:c.value,tabIndex:a}),...r}),(!!s||n)&&O.jsx(A.FormHelperText,{error:!!s,children:s?s==null?void 0:s.message:n})]})})},A5u=({row:e,name:t,rules:n,label:a,options:r,spacing:u,helperText:c,required:s,...l})=>{const{control:d}=Re.useFormContext(),f=(g,_)=>g.includes(_)?g.filter(m=>m!==_):[...g,_];return O.jsx(Re.Controller,{name:t,control:d,rules:n,render:({field:{value:g=[],..._},fieldState:{error:m}})=>O.jsxs(A.FormControl,{component:"fieldset",children:[a&&O.jsx(A.FormLabel,{component:"legend",sx:{typography:"body2"},required:s,children:a}),O.jsx(A.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(v=>O.jsx(A.FormControlLabel,{control:O.jsx(A.Checkbox,{checked:g.includes(v.value),onChange:()=>_.onChange(f(g,v.value))}),label:v.label,...l},v.value))}),(!!m||c)&&O.jsx(A.FormHelperText,{error:!!m,sx:v=>({color:l.disabled?v.palette.grey[500]:void 0}),children:m?m==null?void 0:m.message:c})]})})},R5u=({keyName:e,inputs:t=[],rules:n,tabIndex:a,...r})=>{const u=o.useRef(null),{control:c,setValue:s,formState:{errors:l}}=Re.useFormContext(),d=_=>{const m=_.clipboardData.getData("text").split("");t.map((v,h)=>s(v,m[h])),_.preventDefault()},f=(_,m)=>{const{maxLength:v,value:h,name:C}=_.target,p=C.replace(e,""),y=Number(p),S=document.querySelector(`input[name=${e}${y+1}]`);h.length>v&&(_.target.value=h[0]),h.length>=v&&y<6&&S!==null&&S.focus(),m(_)};nIn("paste",d,u);const g=t.some(_=>l[_]);return O.jsxs(A.Stack,{children:[O.jsx(A.Stack,{direction:"row",spacing:2,justifyContent:"center",ref:u,children:t.map((_,m)=>O.jsx(Re.Controller,{name:`${e}${m+1}`,control:c,rules:n,render:({field:v,fieldState:{error:h}})=>O.jsx(A.TextField,{...r,...v,autoComplete:"none",error:!!h,autoFocus:m===0,placeholder:"-",onChange:C=>{f(C,v.onChange)},onFocus:C=>C.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&&O.jsx(A.FormHelperText,{error:!0,sx:{px:2},children:"Código é obrigatório"})]})},z5u=({name:e,rules:t,helperText:n,...a})=>{const{control:r}=Re.useFormContext();return O.jsx(Re.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,...s},fieldState:{error:l}})=>O.jsx($Zn,{...s,onChangeColor:c,inputRef:u,fullWidth:!0,error:!!l,helperText:(l==null?void 0:l.message)||n,...a})})},H5u=({name:e,rules:t,tabIndex:n,helperText:a,required:r,...u})=>{const{control:c}=Re.useFormContext();return O.jsx(Re.Controller,{name:e,control:c,rules:t,render:({field:{ref:s,...l},fieldState:{error:d}})=>{var f;return O.jsx(_Z.DatePicker,{inputRef:s,format:"dd/MM/yyyy",localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",...u.localeText},...l,...u,value:l.value?new Date(l.value):null,slotProps:{textField:{...(f=u.slotProps)==null?void 0:f.textField,required:r,error:!!d,helperText:(d==null?void 0:d.message)||a,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})},V5u=({name:e,label:t,rules:n,tabIndex:a,helperText:r,required:u,...c})=>{const{control:s,setError:l}=Re.useFormContext();return O.jsx(Re.Controller,{name:e,control:s,rules:n,render:({field:{value:d,onChange:f},fieldState:{error:g}})=>O.jsx(_Z.DateRangePicker,{format:"dd/MM/yyyy",localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",...c.localeText},value:[(d==null?void 0:d.startDate)||null,(d==null?void 0:d.endDate)||null],onChange:_=>f({startDate:_[0],endDate:_[1]}),onError:_=>{l(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}})})},F5u=({name:e,rules:t,tabIndex:n,helperText:a,required:r,...u})=>{const{control:c}=Re.useFormContext();return O.jsx(Re.Controller,{name:e,control:c,rules:t,render:({field:{ref:s,...l},fieldState:{error:d}})=>{var f;return O.jsx(_Z.DateTimePicker,{format:"dd/MM/yyyy HH:mm",inputRef:s,localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",...u.localeText},...l,...u,value:l.value?new Date(l.value):null,slotProps:{textField:{...(f=u.slotProps)==null?void 0:f.textField,required:r,error:!!d,helperText:(d==null?void 0:d.message)||a,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})},N5u=({id:e,children:t,onSubmit:n,methods:a,...r})=>O.jsx(Re.FormProvider,{...a,children:O.jsx(A.Stack,{component:"form",id:e,onSubmit:n,flex:1,width:1,noValidate:!0,...r,children:t})}),T5u=({name:e,helperText:t,rules:n,...a})=>{const{control:r}=Re.useFormContext();return O.jsx(Re.Controller,{name:e,control:r,rules:n,render:({field:{ref:u,value:c,...s},fieldState:{error:l}})=>O.jsx(aWn,{value:c,inputRef:u,fullWidth:!0,error:!!l,helperText:(l==null?void 0:l.message)||t,...a,...s,name:e})})},Z5u=({name:e,label:t="",rules:n,helperText:a,changed:r,...u})=>{const{control:c}=Re.useFormContext();return O.jsx(Re.Controller,{name:e,control:c,rules:n,render:({field:s,fieldState:{error:l}})=>O.jsx(A.Autocomplete,{...s,onChange:(d,f)=>{r&&r(f),s.onChange(f)},renderInput:d=>O.jsx(A.TextField,{label:t,error:!!l,helperText:l?l==null?void 0:l.message:a,...d}),...u})})},U5u=({name:e,helperText:t,rules:n,onChange:a,...r})=>{const{control:u}=Re.useFormContext();return O.jsx(Re.Controller,{name:e,control:u,rules:n,render:({field:c,fieldState:{error:s}})=>O.jsx(xbt,{...c,onChange:l=>{c.onChange(l),a&&a(l)},fullWidth:!0,error:!!s,helperText:(s==null?void 0:s.message)||t,...r})})},G5u=({name:e,sx:t,rules:n,passwordSize:a,specialCharacter:r,upperCaseChar:u,numberChar:c,showErrorMessage:s,match:l,...d})=>{const{watch:f}=Re.useFormContext(),g=f(e),[_,m]=o.useState(!1),{hasNumberChar:v,hasSpecialCharacter:h,hasUpperCaseChar:C,isLengthValid:p}=Vbt(g,a,c,r,u);return O.jsx(pn,{...d,name:e,type:_?"text":"password",InputProps:{endAdornment:O.jsx(A.InputAdornment,{position:"end",children:O.jsx(A.IconButton,{onClick:()=>m(!_),edge:"end","aria-label":"Mostrar/Ocultar senha",children:O.jsx(we,{icon:_?"VIEW_ON":"VIEW_OFF"})})})},rules:{...n,validate:{...n==null?void 0:n.validate,validationPassword:y=>{const S=Vbt(y,a,c,r,u);return!S.hasNumberChar||!S.hasSpecialCharacter||!S.hasUpperCaseChar||!S.isLengthValid?"Senha inválida":l&&l.fieldPassword&&f(l.fieldPassword)!==y?"As senhas devem ser iguais":!0}}},sx:{...t,"& .MuiFormHelperText-root":{display:(!h||!C||!p||!v)&&!s?"none":void 0}}})},IWn=({name:e,rules:t,row:n,label:a,options:r,spacing:u,helperText:c,decorated:s,onChange:l,tabIndex:d,required:f,disabled:g,..._})=>{const{control:m}=Re.useFormContext(),v=a?`${e}-${a}`:"";return O.jsx(Re.Controller,{name:e,control:m,rules:t,render:({field:h,fieldState:{error:C}})=>O.jsxs(A.FormControl,{component:"fieldset",sx:{...s&&{paddingLeft:1.5}},children:[a&&O.jsx(A.FormLabel,{component:"legend",id:v,sx:{typography:"body2"},required:f,children:a}),O.jsx(A.RadioGroup,{..._,...h,onChange:(p,y)=>{h.onChange(p),l&&l(p,y)},"aria-labelledby":v,row:n,children:r.map(p=>O.jsx(A.FormControlLabel,{value:p.value,control:O.jsx(A.Radio,{inputProps:{tabIndex:d},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}},...s&&{border:`1px solid ${A.alpha(y.grey[500],.32)}`,borderRadius:1,padding:.25,paddingRight:(u||0)/2||1,...h.value===p.value&&{borderColor:"primary.main",backgroundColor:A.alpha(y.primary.main,.05)}}})},p.value))}),(!!C||c)&&O.jsx(A.FormHelperText,{error:!!C,sx:p=>({color:g?p.palette.grey[500]:void 0}),children:C?C==null?void 0:C.message:c})]})})},K5u=({name:e,rules:t,tabIndex:n,helperText:a,required:r,...u})=>{const{control:c}=Re.useFormContext();return O.jsx(Re.Controller,{name:e,control:c,rules:t,render:({field:{ref:s,...l},fieldState:{error:d}})=>{var f;return O.jsx(_Z.TimePicker,{ampm:!1,format:"HH:mm",inputRef:s,localeText:{fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",...u.localeText},...l,...u,value:l.value?new Date(l.value):null,slotProps:{textField:{...(f=u.slotProps)==null?void 0:f.textField,error:!!d,required:r,helperText:(d==null?void 0:d.message)||a,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})},Y5u=({onFileCropped:e,onImageUploaded:t,onCancel:n,aspect:a,label:r,image:u="",uploading:c,file:s,tabIndex:l,...d})=>{const{id:f,setCropModalOpen:g,handleRemove:_,cropModalOpen:m,cancelChanges:v,saveChanges:h,previewImage:C,setCropper:p,preview:y,closePreviewImage:S}=iYn({onFileCropped:e,onImageUploaded:t,onCancel:n});return O.jsxs(O.Fragment,{children:[O.jsxs(A.Stack,{position:"relative",alignItems:"center",justifyContent:"center",children:[c&&O.jsx(clu,{}),O.jsx(aYn,{...d,id:f,file:s,onDrop:w=>{if(w.length>0){g(!0);const j=new FileReader;j.addEventListener("load",()=>{var M;const b=((M=j.result)==null?void 0:M.toString())||"";t(b),e(void 0)}),j.readAsDataURL(w[0])}},image:u,tabIndex:l})]}),O.jsx(oYn,{id:f,open:m,onClose:v,label:r,aspectRatio:a,imageSrc:u,onRemove:_,onSave:h,onPreview:C,onInitialized:p}),O.jsx(A.Dialog,{open:!!y,onClose:S,scroll:"body",PaperProps:{sx:{p:2}},children:y&&O.jsx("img",{src:y,alt:"Preview"})})]})};function RYn(e,t){const{watch:n,setValue:a}=Re.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(v=>v!==_);a(e,m)},file:r,setFileValue:u}}const X5u=({name:e,rules:t,helperText:n,aspect:a,label:r,image:u,onFileCropped:c,onImageUploaded:s,onCancel:l,...d})=>{const{control:f}=Re.useFormContext(),{uploadFile:g,file:_,setFileValue:m}=RYn(e);return O.jsx(Re.Controller,{name:e,control:f,rules:t,render:({field:{value:v},fieldState:{error:h}})=>O.jsx(Y5u,{accept:{"image/*":[]},file:v?_:void 0,onFileCropped:C=>{g(C),c&&c(C)},onImageUploaded:s,onCancel:()=>{m(void 0),l&&l()},error:!!h,disableMultiple:!0,helperText:(!!h||n)&&O.jsx(A.FormHelperText,{error:!!h,sx:{px:2},children:h?h==null?void 0:h.message:n}),aspect:a,label:r,image:u,...d})})},Q5u=({name:e,rules:t,helperText:n,aspect:a,label:r,image:u,onFileCropped:c,onImageUploaded:s,onCancel:l,...d})=>{const{control:f}=Re.useFormContext(),{uploadFile:g,file:_,setFileValue:m}=RYn(e);return O.jsx(Re.Controller,{name:e,control:f,rules:t,render:({field:{value:v},fieldState:{error:h}})=>O.jsx(uYn,{accept:{"image/*":[]},file:v?_:void 0,onFileCropped:C=>{g(C),c&&c(C)},onImageUploaded:s,onCancel:()=>{m(void 0),l&&l()},error:!!h,disableMultiple:!0,helperText:(!!h||n)&&O.jsx(A.FormHelperText,{error:!!h,sx:{px:2},children:h?h==null?void 0:h.message:n}),aspect:a,label:r,image:u,...d})})},zYn=A.styled(A.Button)(({theme:e})=>({borderColor:e.palette.grey[300]})),HYn=A.styled(A.Box)(({theme:e})=>({border:"1.5px solid",borderColor:e.palette.grey[300],height:450,width:"40%",borderRadius:8})),J5u=({selectedItems:e,items:t,loading:n,searchText:a,onAdd:r,onRemove:u,search:c,itemsTitle:s,selectedItemsTitle:l,additionalContent:d,enableSearchInSelectedItems:f,onSearch:g})=>{const[_,m]=o.useState(""),v=A.debounce(g,400),h=t.filter(E=>!e.some(L=>L.id===E.id)),C=e.filter(E=>{var L;return(L=E.name)==null?void 0:L.toLowerCase().includes(_.toLowerCase())}),p=f?C:t.filter(E=>e.some(L=>L.id===E.id)),[y,S]=o.useState([]),[w,j]=o.useState([]),b=()=>{r(y),S([])},M=()=>{u(w),j([])},P=E=>{j(E?p:[])},k=E=>{S(E?h:[])},W=(E,L)=>{j(L?B=>[...B,E]:B=>B.filter($=>$.id!==E.id))},I=(E,L)=>{S(L?B=>[...B,E]:B=>B.filter($=>$.id!==E.id))},D=E=>{E.key==="Enter"&&E.preventDefault()};return O.jsx(A.Stack,{children:O.jsxs(A.Stack,{direction:"row",alignItems:"center",gap:3,children:[O.jsx(HYn,{display:"flex",flex:1,children:O.jsxs(A.Stack,{flex:1,children:[O.jsxs(A.Stack,{direction:"row",gap:1,padding:2,children:[O.jsx(A.Checkbox,{size:"small",indeterminate:y.length>0&&y.length!==h.length,checked:y.length>0&&y.length===h.length,onChange:E=>k(E.target.checked)}),O.jsxs(A.Stack,{children:[O.jsx(A.Typography,{variant:"subtitle2",color:"text.primary",children:`${s} cadastrados`}),O.jsx(A.Typography,{variant:"caption",color:"text.disabled",children:`${y.length}/${h.length} selecionados`})]})]}),O.jsx(A.Divider,{}),O.jsxs(A.Stack,{p:2,flex:1,children:[O.jsxs(A.Stack,{direction:"row",gap:1,children:[O.jsx(Fle,{iconPosition:"start",placeholder:"Buscar",onKeyDown:D,size:"small",fullWidth:!0,trigger:"change",onSearch:E=>v(E)}),d]}),O.jsx(sWn,{isLoading:n,loading:O.jsx(A.Stack,{alignItems:"center",justifyContent:"center",flex:1,children:O.jsx(A.CircularProgress,{})}),isEmpty:h.length===0,empty:O.jsx(uvt,{text:c?`Nenhum ${a} encontrado`:`Nenhum ${a} disponível`,sx:{svg:{height:140}}}),children:O.jsx(ZT,{sx:{maxHeight:280},children:h.map(E=>O.jsxs(A.Stack,{gap:1,marginTop:"8px",children:[O.jsxs(A.Stack,{direction:"row",gap:.5,alignItems:"center",marginTop:"8px",children:[O.jsx(A.Checkbox,{size:"small",checked:y.includes(E),onChange:L=>I(E,L.target.checked)}),E.label]}),O.jsx(A.Divider,{})]},E.id))})})]})]})}),O.jsxs(A.Stack,{gap:3,children:[O.jsx(zYn,{variant:"outlined",onClick:b,children:O.jsx(we,{icon:"ARROW_RIGHT_SIMPLE"})}),O.jsx(zYn,{variant:"outlined",onClick:M,children:O.jsx(we,{icon:"ARROW_LEFT_SIMPLE"})})]}),O.jsx(HYn,{display:"flex",flex:1,children:O.jsxs(A.Stack,{flex:1,children:[O.jsxs(A.Stack,{direction:"row",gap:1,padding:2,children:[O.jsx(A.Checkbox,{size:"small",indeterminate:w.length>0&&w.length!==p.length,checked:w.length>0&&w.length===p.length,onChange:E=>P(E.target.checked)}),O.jsxs(A.Stack,{children:[O.jsx(A.Typography,{variant:"subtitle2",color:"text.primary",children:`${l} selecionados`}),O.jsx(A.Typography,{variant:"caption",color:"text.disabled",children:`${w.length}/${p.length} selecionados`})]})]}),O.jsx(A.Divider,{}),O.jsxs(A.Stack,{p:2,gap:1,children:[f&&O.jsx(Fle,{iconPosition:"start",placeholder:"Buscar",size:"small",fullWidth:!0,trigger:"change",onSearch:E=>m(E??""),onKeyDown:D}),O.jsx(sWn,{isLoading:n,loading:O.jsx(A.Stack,{alignItems:"center",justifyContent:"center",flex:1,children:O.jsx(A.CircularProgress,{})}),isEmpty:p.length===0,empty:O.jsx(uvt,{text:_?`Nenhum ${a} encontrado`:`Nenhum ${a} selecionado`,sx:{svg:{height:140},marginTop:"56px",backgroundColor:"transparent"}}),children:O.jsx(ZT,{sx:{maxHeight:280},children:p.map(E=>O.jsxs(A.Stack,{gap:1,children:[O.jsxs(A.Stack,{direction:"row",gap:.5,alignItems:"center",marginTop:"8px",children:[O.jsx(A.Checkbox,{size:"small",checked:w.includes(E),onChange:L=>W(E,L.target.checked)}),E.label]}),O.jsx(A.Divider,{})]},E.id))})})]})]})})]})})},q5u=Object.freeze(Object.defineProperty({__proto__:null,default:yrr},Symbol.toStringTag,{value:"Module"}));ee.ActionButton=EDn,ee.Address=W5u,ee.AdvancedRule=P5u,ee.Autocomplete=BDn,ee.AutocompleteDetailed=$Dn,ee.AutocompleteDetailedField=$5u,ee.AutocompleteField=oZ,ee.BuilderLayout=qBo,ee.BuilderSidebar=LHo,ee.Carousel=iDo,ee.CarouselArrowIndex=ODo,ee.CarouselArrows=sDo,ee.CarouselDots=lDo,ee.Checkbox=x5u,ee.Codes=R5u,ee.ColorPickerField=z5u,ee.ColorPickerInput=$Zn,ee.Common=z1u,ee.CommonSSR=V1u,ee.Confirm=F1u,ee.CustomAvatar=WDn,ee.CustomAvatarGroup=IFn,ee.DataGrid=CBn,ee.DatePicker=H5u,ee.DateRangePicker=V5u,ee.DateTimePicker=F5u,ee.Delayed=Z1u,ee.DialogAnimate=Urr,ee.Drawer=niu,ee.EmptyContent=qHn,ee.EmptyView=uvt,ee.Error=aiu,ee.ExpandableGroup=BYn,ee.FabButtonAnimate=rzn,ee.Field=pn,ee.FilterRule=xlu,ee.FixedProgressBar=Obt,ee.Form=N5u,ee.FrameSkeleton=Plu,ee.HelpButton=xDn,ee.Icon=we,ee.IconButtonAnimate=azn,ee.Iconify=OGn,ee.IllustrationEmptyContent=wxn,ee.ImageCrop=tKn,ee.Incrementer=aWn,ee.IncrementerField=T5u,ee.Label=iWn,ee.Lightbox=wBo,ee.ListingRules=Hlu,ee.LoadingScreen=Iuu,ee.ManualRule=Alu,ee.MaskedInput=lWn,ee.MaskedInputField=AYn,ee.MaterialDesignContent=qpt,ee.MenuPopover=wKn,ee.Modal=MKn,ee.ModalActions=quu,ee.MotionContainer=oar,ee.MotionLazyContainer=Tpt,ee.MotionViewport=iar,ee.MultiCheckbox=A5u,ee.MultipleChipField=Z5u,ee.NoData=Mxn,ee.NumberInput=xbt,ee.NumberInputField=U5u,ee.PasswordField=G5u,ee.PasswordRules=i2u,ee.PopoverSelect=glu,ee.Portal=LKn,ee.RadioGroupField=IWn,ee.Result=sWn,ee.SavedChanges=P2u,ee.Scrollbar=ZT,ee.SearchInput=Fle,ee.SeoPreview=Blu,ee.SnackbarContent=Jpt,ee.SnackbarProvider=Dzn,ee.SplashScreen=E2u,ee.Steps=D2u,ee.StyledTab=I2u,ee.StyledTabs=B2u,ee.Summary=hlu,ee.SwapList=J5u,ee.Switch=xYn,ee.TRANSITION=Lxn,ee.TabPanel=W2u,ee.TableEmptyRows=kDo,ee.TableHeadCustom=DDo,ee.TableNoData=PDo,ee.TablePaginationCustom=BDo,ee.TableSelectedAction=IDo,ee.TableSkeleton=EDo,ee.TextAnimate=Grr,ee.TextMaxLine=Wj,ee.ThemeProvider=WUn,ee.TimePicker=K5u,ee.ToggleButtonGroup=sYn,ee.Transition=Nht,ee.Upload=rYn,ee.UploadAvatar=aYn,ee.UploadAvatarWithCropField=X5u,ee.UploadBox=ilu,ee.UploadIllustration=jxn,ee.UploadWithCrop=uYn,ee.UploadWithCropField=Q5u,ee.Webhook=B5u,ee.WhiteBox=cYn,ee.color=Cau,ee.compare=dHo,ee.cssStyles=yDo,ee.emptyRows=jDo,ee.file=o2u,ee.formatNumber=ouu,ee.formatTime=C2u,ee.generateQuery=EKn,ee.getComparator=wDo,ee.loadable=L2u,ee.mask=w2u,ee.number=euu,ee.routes=y2u,ee.sort=j2u,ee.useActiveElement=eWo,ee.useApiMessage=pHo,ee.useCarousel=oDo,ee.useCopyToClipboard=tWo,ee.useDatagrid=zFn,ee.useDeepCompareEffect=_Ho,ee.useEventListener=nIn,ee.useIsMounting=vHo,ee.useLightBox=PBo,ee.useOffSetTop=yHo,ee.useOnClickOutside=bHo,ee.usePagination=CHo,ee.usePopover=Amt,ee.useResponsive=Npt,ee.useSnackbar=Izn,ee.useTable=MDo,ee.useTabs=hHo,ee.useToggle=xmt,ee.uuidv4=M2u,ee.validators=n2u,ee.varBgColor=lqn,ee.varBgKenburns=sqn,ee.varBgPan=fqn,ee.varBounce=oqn,ee.varContainer=_ht,ee.varFade=mse,ee.varFlip=rqn,ee.varHover=cqn,ee.varPath=eqn,ee.varRotate=uqn,ee.varScale=iqn,ee.varSlide=aqn,ee.varTranEnter=Xe,ee.varTranExit=at,ee.varTranHover=tqn,ee.varZoom=nqn,Object.defineProperty(ee,Symbol.toStringTag,{value:"Module"})});
36631
+ `&&(_-=1),r.right.push({startLine:u.right,endLine:u.right+_}),u.right+=d;break;default:throw new Error("Diff type was not defined.")}}}),r},t.prototype.setCodeMarkers=function(n){n===void 0&&(n={left:[],right:[]});for(var a=[],r={left:[],right:[]},u=0;u<n.left.length;u++){var c={startRow:n.left[u].startLine-1,endRow:n.left[u].endLine,type:"text",className:"codeMarker"};r.left.push(c)}for(var u=0;u<n.right.length;u++){var c={startRow:n.right[u].startLine-1,endRow:n.right[u].endLine,type:"text",className:"codeMarker"};r.right.push(c)}return a[0]=r.left,a[1]=r.right,a},t.prototype.render=function(){var n=this.diff();return SYn.createElement(n5u.default,{name:this.props.name,className:this.props.className,focus:this.props.focus,orientation:this.props.orientation,splits:this.props.splits,mode:this.props.mode,theme:this.props.theme,height:this.props.height,width:this.props.width,fontSize:this.props.fontSize,showGutter:this.props.showGutter,onChange:this.onChange,onPaste:this.props.onPaste,onLoad:this.props.onLoad,onScroll:this.props.onScroll,minLines:this.props.minLines,maxLines:this.props.maxLines,readOnly:this.props.readOnly,highlightActiveLine:this.props.highlightActiveLine,showPrintMargin:this.props.showPrintMargin,tabSize:this.props.tabSize,cursorStart:this.props.cursorStart,editorProps:this.props.editorProps,style:this.props.style,scrollMargin:this.props.scrollMargin,setOptions:this.props.setOptions,wrapEnabled:this.props.wrapEnabled,enableBasicAutocompletion:this.props.enableBasicAutocompletion,enableLiveAutocompletion:this.props.enableLiveAutocompletion,value:this.state.value,markers:n})},t.propTypes={cursorStart:Mt.number,editorProps:Mt.object,enableBasicAutocompletion:Mt.bool,enableLiveAutocompletion:Mt.bool,focus:Mt.bool,fontSize:Mt.number,height:Mt.string,highlightActiveLine:Mt.bool,maxLines:Mt.number,minLines:Mt.number,mode:Mt.string,name:Mt.string,className:Mt.string,onLoad:Mt.func,onPaste:Mt.func,onScroll:Mt.func,onChange:Mt.func,orientation:Mt.string,readOnly:Mt.bool,scrollMargin:Mt.array,setOptions:Mt.object,showGutter:Mt.bool,showPrintMargin:Mt.bool,splits:Mt.number,style:Mt.object,tabSize:Mt.number,theme:Mt.string,value:Mt.array,width:Mt.string,wrapEnabled:Mt.bool},t.defaultProps={cursorStart:1,editorProps:{},enableBasicAutocompletion:!1,enableLiveAutocompletion:!1,focus:!1,fontSize:12,height:"500px",highlightActiveLine:!0,maxLines:null,minLines:null,mode:"",name:"ace-editor",onLoad:null,onScroll:null,onPaste:null,onChange:null,orientation:"beside",readOnly:!1,scrollMargin:[0,0,0,0],setOptions:{},showGutter:!0,showPrintMargin:!0,splits:2,style:{},tabSize:4,theme:"github",value:["",""],width:"500px",wrapEnabled:!0},t}(SYn.Component);jWn.default=a5u,Object.defineProperty(Zle,"__esModule",{value:!0}),Zle.diff=Zle.split=void 0;var i5u=pWn,o5u=jWn;Zle.diff=o5u.default;var u5u=Qbt;Zle.split=u5u.default;var c5u=Zle.default=i5u.default;const DYn=A.styled(A.Stack)(({theme:e})=>({borderBottom:`1px solid ${A.alpha(e.palette.grey[500],.32)}`,borderTop:`1px solid ${A.alpha(e.palette.grey[500],.32)}`,padding:16})),l5u=A.styled(A.Stack)(({theme:e})=>({border:`1px solid ${A.alpha(e.palette.grey[500],.32)}`,borderRadius:8,padding:12,"& .MuiInputBase-root":{background:e.palette.grey[100]}})),s5u=A.styled(A.Stack)(({theme:e})=>({display:"flex",textAlign:"center",flexDirection:"row",alignItems:"center",width:"100%",gap:8,height:34,backgroundColor:"#fff",padding:"8px 16px",borderRadius:8,border:`1px solid ${A.alpha(e.palette.grey[500],.24)}`,cursor:"pointer",color:e.palette.text.disabled,"&:hover, &:focus":{border:`1px solid ${e.palette.primary.main}`,backgroundColor:A.alpha(e.palette.primary.main,.05)}})),f5u=A.styled(A.Stack)(({theme:e})=>({width:"100%","& fieldset":{border:`1px solid ${A.alpha(e.palette.grey[500],.24)}`,borderRadius:8,"& legend":{color:e.palette.text.disabled,fontSize:12}}})),IYn=A.styled(A.IconButton)({marginLeft:"auto",padding:0}),d5u=({openPopover:e,handleClose:t,addItem:n})=>{const[a,r]=o.useState(""),u=()=>{n(a),t(),r("")};return O.jsxs(A.Popover,{open:!!e,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:e,onClose:t,sx:{maxWidth:464},title:"Novo Argumento",children:[O.jsx(A.Typography,{variant:"subtitle1",color:"text.primary",p:1,children:"Novo Argumento"}),O.jsx(DYn,{children:O.jsx(A.TextField,{value:a,onChange:c=>r(c.target.value),name:"item",label:"Novo argumento",size:"small"})}),O.jsxs(A.Stack,{p:1,direction:"row",justifyContent:"flex-end",spacing:1,children:[O.jsx(A.Button,{variant:"outlined",color:"inherit",size:"small",onClick:t,children:"Cancelar"}),O.jsx(A.Button,{variant:"contained",color:"primary",size:"small",startIcon:O.jsx(we,{icon:"SAVE_MARK"}),disabled:!a||a==="",onClick:u,children:"Salvar"})]})]})},eyt=({label:e,itens:t,argumentsValues:n,fields:a,addItem:r,removeItem:u,insertItemSQL:c})=>{const[s,l]=o.useState(!1),d=Amt(),f=()=>{l(!s)},g=(m,v)=>{m.stopPropagation(),u&&u(v)},_=m=>{c(n?` $ARG[${m}]`:a?` this.${m}`:` ${m}`)};return O.jsxs(A.Stack,{children:[O.jsxs(A.Stack,{direction:"row",alignItems:"center",spacing:1.5,padding:1,paddingLeft:0,children:[O.jsx(IYn,{edge:"end",onClick:f,children:O.jsx(we,{icon:s?"CHEVRON_UP":"CHEVRON_RIGHT"})}),O.jsx(A.Typography,{variant:"overline",color:"text.primary",children:e}),r&&O.jsxs(O.Fragment,{children:[O.jsx(IYn,{edge:"end",onClick:d.onOpen,children:O.jsx(we,{icon:"SIMPLE_ADD"})}),O.jsx(d5u,{addItem:r,handleClose:d.onClose,openPopover:d.open})]})]}),s&&O.jsx(A.Stack,{spacing:.5,children:O.jsx(ZT,{sx:{maxHeight:150},children:t==null?void 0:t.map((m,v)=>O.jsxs(s5u,{direction:"row",justifyContent:"space-between",onClick:()=>_(m),children:[O.jsx(A.Typography,{variant:"caption",textAlign:"center",width:"100%",children:m}),u&&O.jsx(A.IconButton,{edge:"end",onClick:h=>g(h,m),children:O.jsx(we,{icon:"DELETE_MARK_BUTTON_02"})})]},v))})})]})},g5u=({fieldsSelect:e,argumentsValues:t,onChangeArguments:n,sql:a,setSql:r,setFilterRule:u})=>{const[c,s]=o.useState(),{setValue:l}=Re.useFormContext(),[d,f]=o.useState(1),[g,_]=o.useState(),m=y=>{g.session.insert(d,` ${y} `)},v=y=>{n([...t||[],y])},h=y=>{n(t==null?void 0:t.filter(S=>S!==y))},C=y=>{r(y),u(y),l("groups",void 0)},p=c?e.filter(y=>{var S;return y.id.toString().toLocaleLowerCase().includes(c)||y.description.toString().toLocaleLowerCase().includes(c)||((S=y.name)==null?void 0:S.toString().toLocaleLowerCase().includes(c))}):e;return O.jsxs(A.Stack,{direction:"row",padding:1.5,spacing:1.5,children:[O.jsxs(l5u,{children:[O.jsx(Fle,{value:c,trigger:"change",onSearch:y=>s(y==null?void 0:y.toLocaleLowerCase()),fullWidth:!0,size:"small",placeholder:"Buscar",iconPosition:"start"}),O.jsx(eyt,{label:"Campos",fields:!0,itens:p.map(y=>y.name),insertItemSQL:m}),O.jsx(eyt,{label:"Argumentos",argumentsValues:!0,itens:t,addItem:v,removeItem:h,insertItemSQL:m}),O.jsx(eyt,{label:"Operadores",insertItemSQL:m,itens:["=",">","<","<=",">=","!=","IS NULL","IN","LIKE","NOT IN","NOT LIKE","IS NOT NULL"]}),O.jsx(eyt,{label:"Filtros",fields:!0,insertItemSQL:m,itens:p.map(y=>y.name)})]}),O.jsx(f5u,{children:O.jsxs("fieldset",{children:[O.jsx("legend",{children:"Regras de listagem"}),O.jsx(c5u,{width:"100%",mode:"sql",theme:"chrome",name:"rule",fontSize:14,onChange:C,onCursorChange:y=>f(y.getCursor()),value:a,onLoad:y=>_(y),showPrintMargin:!1,showGutter:!1,highlightActiveLine:!1,setOptions:{enableBasicAutocompletion:!0,enableLiveAutocompletion:!0,enableSnippets:!0,showLineNumbers:!1,tabSize:2}})]})})]})},_5u=({data:e,fields:t,isLoading:n,isError:a})=>O.jsxs(A.Stack,{children:[O.jsx(A.Typography,{variant:"subtitle2",color:"text.secondary",children:"PRÉ VISUALIZAÇÃO DOS RESULTADOS DA LISTAGEM"}),a&&O.jsx(A.Stack,{children:"Falha ao gerar resultado"}),e&&O.jsx(CBn,{columns:t==null?void 0:t.map(r=>({field:r,headerName:r,width:150,type:"string"})),loading:n,rows:e,disableRowSelectionOnClick:!0,disableColumnMenu:!0,disableColumnResize:!0,showColumnVerticalBorder:!0,hideFooter:!0})]}),m5u=({openPopover:e,handleClose:t,argumentsValues:n,filter:a,onExecute:r})=>{const[u,c]=o.useState([]),s=(d,f)=>{if(f&&f!=="")u.filter(_=>_.name===d).length>0?c(u.map(_=>_.name===d?{name:d,value:f}:_)):c([...u||[],{name:d,value:f}]);else{const g=u.filter(_=>_.name===d);c(g)}},l=()=>{let d=a||"";return u.forEach(f=>{d=d.replace(`$ARG[${f.name}]`,`'${f.value}'`)}),d};return O.jsxs(A.Popover,{open:!!e,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:e,onClose:t,title:"Pré-visualizar",children:[O.jsx(A.Typography,{variant:"subtitle1",color:"text.primary",p:1,children:"Pré-visualizar"}),O.jsx(DYn,{children:n==null?void 0:n.map((d,f)=>O.jsx(A.TextField,{name:d,label:d,size:"small",onChange:g=>s(d,g.target.value),required:!0},f))}),O.jsxs(A.Stack,{p:2,direction:"row",justifyContent:"flex-end",spacing:1,children:[O.jsx(A.Button,{variant:"outlined",color:"inherit",size:"small",onClick:t,children:"Cancelar"}),O.jsx(A.Button,{variant:"contained",color:"primary",size:"small",startIcon:O.jsx(we,{icon:"PLAY_SIMPLE"}),onClick:()=>r(l()),disabled:u.length<n.length,children:"Executar"})]})]})},v5u=A.styled(A.Stack)(({theme:e})=>({border:`1px solid ${A.alpha(e.palette.grey[500],.32)}`,borderRadius:8,alignItems:"center",overflow:"hidden"})),h5u=A.styled(A.Stack)(()=>({backgroundColor:"#F5F5F5",padding:8,width:"100%",justifyContent:"space-between",alignItems:"center",gap:12,"& .MuiInputBase-root":{backgroundColor:"#fff"}}));A.styled(A.Stack)(({theme:e})=>({border:`1px solid ${A.alpha(e.palette.grey[500],.32)}`,borderRadius:8,alignItems:"center"}));const C5u=A.styled(A.Collapse)(()=>({width:"100%",padding:"12px 16px"})),BYn=({description:e,name:t,children:n,header:a,onDelete:r})=>{const[u,c]=xmt(!0);return O.jsxs(v5u,{children:[O.jsxs(h5u,{direction:"row",children:[O.jsxs(A.Stack,{direction:"row",alignItems:"center",gap:1.5,flex:1,children:[O.jsx(A.IconButton,{edge:"end",onClick:c,children:O.jsx(we,{icon:u?"CHEVRON_UP":"CHEVRON_RIGHT"})}),O.jsx(A.Typography,{variant:"overline",color:"text.primary",children:t}),O.jsx(A.Typography,{variant:"overline",color:"text.secondary",children:e}),O.jsx(A.Stack,{flex:1,children:a})]}),O.jsx(A.IconButton,{color:"error",onClick:r,children:O.jsx(we,{icon:"DELETE_MARK_BUTTON_02"})})]}),O.jsx(C5u,{in:u,timeout:"auto",unmountOnExit:!0,children:n})]})},oZ=({name:e,helperText:t,rules:n,onSelectOption:a,...r})=>{const{control:u}=Re.useFormContext();return O.jsx(Re.Controller,{name:e,control:u,rules:n,render:({field:c,fieldState:{error:s}})=>O.jsx(BDn,{...c,...r,onChange:l=>{a&&a(l,c.value),c.onChange(l)},error:!!s,helperText:(s==null?void 0:s.message)||t})})},pn=({name:e,helperText:t,rules:n,onChange:a,tabIndex:r,...u})=>{const{control:c}=Re.useFormContext();return O.jsx(Re.Controller,{name:e,control:c,rules:n,render:({field:{ref:s,...l},fieldState:{error:d}})=>O.jsx(A.TextField,{...l,onChange:f=>{l.onChange(f),a&&a(f)},inputRef:s,fullWidth:!0,error:!!d,helperText:(d==null?void 0:d.message)||t,...u,inputProps:{...u.inputProps,tabIndex:r}})})},b5u=A.styled(A.Stack)(({theme:e})=>({border:`1px solid ${A.alpha(e.palette.primary.main,.32)}`,backgroundColor:A.alpha(e.palette.primary.main,.08),borderRadius:8,padding:8,paddingLeft:24,alignItems:"center"})),y5u=A.styled(A.IconButton)(()=>({height:"28px",marginLeft:"16px","&:hover":{backgroundColor:"transparent"}})),WYn=A.styled(oZ)(()=>({width:230})),p5u=({index:e,indexGroup:t,removeConditional:n,fieldsSelect:a})=>{const{watch:r}=Re.useFormContext(),u=`groups.[${t}].conditionals[${e}].field`,c=`groups.[${t}].conditionals[${e}].conditional`,s=`groups.[${t}].conditionals[${e}].type`,l=`groups.[${t}].conditionals[${e}].value`,d=[{value:"=",label:"Igual a"},{value:">",label:"Maior que"},{value:"<",label:"Menor que"},{value:"<=",label:"Menor ou igual a"},{value:">=",label:"Maior ou igual a"},{value:"!=",label:"Diferente de"},{value:"IS NULL",label:"Está vazio"},{value:"IN",label:"Contido em"},{value:"LIKE",label:"Contendo"},{value:"NOT IN",label:"Não contido em"},{value:"NOT LIKE",label:"Não contém"},{value:"IS NOT NULL",label:"Não está vazio"}],f=r(s);return O.jsxs(A.Stack,{direction:"row",spacing:1.5,alignItems:"center",width:1,children:[O.jsx(oZ,{label:"Se",name:u,size:"small",fullWidth:!0,options:a==null?void 0:a.map(g=>({value:g.name,label:g.description}))}),O.jsx(oZ,{label:"Estado",name:c,size:"small",fullWidth:!0,options:d}),O.jsx(oZ,{label:"Objetivo",name:`groups.[${t}].conditionals[${e}].type`,size:"small",fullWidth:!0,options:[{label:"Valor",value:"value"},{label:"Campo",value:"field"}]}),f==="value"?O.jsx(pn,{label:"Valor",name:l,size:"small",fullWidth:!0}):O.jsx(oZ,{label:"Se",name:l,size:"small",fullWidth:!0,options:a==null?void 0:a.map(g=>({value:g.name,label:g.description}))}),O.jsx(y5u,{color:"error",onClick:()=>{n(e)},children:O.jsx(we,{icon:"DELETE_MARK_BUTTON_02"})})]})},O5u=({index:e,removeGroup:t,fieldsSelect:n})=>{const{control:a}=Re.useFormContext(),r=`groups.[${e}].operator`,{fields:u,append:c,remove:s}=Re.useFieldArray({name:`groups.${e}.conditionals`,control:a});return O.jsx(BYn,{name:`GRUPO ${e+1}`,description:"EXIBIR A LISTAGEM QUANDO ATENDER UMA DAS CONDIÇÕES",header:O.jsx(WYn,{name:r,size:"small",options:[{label:"Qualquer",value:"or"},{label:"Todas as condições",value:"and"}]}),onDelete:()=>t(e),children:O.jsxs(A.Stack,{spacing:1.5,alignItems:"flex-start",children:[u.map((l,d)=>O.jsx(p5u,{index:d,indexGroup:e,removeConditional:f=>s(f),fieldsSelect:n},l.id)),O.jsx(EDn,{actionType:"NEW",onClick:()=>c({field:"",conditional:"=",type:"value",value:""}),variant:"text",size:"small",children:"Adicionar condição"})]})})},j5u=({fieldsSelect:e})=>{const{control:t}=Re.useFormContext(),{fields:n,append:a,remove:r}=Re.useFieldArray({name:"groups",control:t});return O.jsxs(A.Stack,{gap:1.5,children:[O.jsxs(b5u,{direction:"row",spacing:1.5,children:[O.jsx(A.Typography,{variant:"body2",color:"text.light.primary",children:"Se"}),O.jsx(A.Stack,{children:O.jsx(WYn,{size:"small",name:"operator",options:[{label:"Qualquer",value:"or"},{label:"Todas as condições",value:"and"}]})}),O.jsxs(A.Typography,{variant:"body2",color:"text.light.primary",children:["regra de ",O.jsx("strong",{children:"todos os grupos"})," “Se” forem cumpridas,"," ",O.jsx("strong",{children:"irá exibir a listagem."})]})]}),n.map((u,c)=>O.jsx(O5u,{index:c,removeGroup:s=>r(s),fieldsSelect:e},u.id)),O.jsx(A.Button,{size:"large",color:"inherit",startIcon:O.jsx(we,{icon:"SIMPLE_ADD"}),variant:"outlined",fullWidth:!0,onClick:()=>{a({operator:"or",conditionals:[{field:"",conditional:"=",type:"value",value:""}]})},children:"Adicionar grupo"})]})},w5u=A.styled(A.Stack)(({theme:e})=>({border:`1px solid ${A.alpha(e.palette.grey[500],.32)}`,borderRadius:8,marginTop:24})),M5u=A.styled(A.Stack)(()=>({padding:12,borderBottom:"1px solid #e0e0e0"})),$Yn=A.styled(A.ToggleButton)(()=>({lineHeight:"1em"})),L5u=A.styled(A.Stack)(()=>({padding:12})),P5u=({argumentsValues:e,onChangeArguments:t,fieldsSelect:n,onChangeRule:a,onChangeSqlProcessed:r,defaultMode:u,defaultFilter:c,dataPreview:s,errorPreview:l,loadingPreview:d})=>{const[f,g]=o.useState(c||""),[_,m]=xmt(),[v,h]=o.useState(u||"simple"),{watch:C,setValue:p}=Re.useFormContext(),y=Amt(),S=C("operator"),w=C("groups");o.useEffect(()=>()=>{p("config",{})},[]);const j=(P,k)=>{if(k==="advanced"){const W=EKn(w,S);g(W),r(W),a(W)}h(k)},b=P=>{_||v==="simple"||e.length===0?m():y.onOpen(P)},M=P=>{m(),r(P)};return O.jsx(O.Fragment,{children:O.jsxs(w5u,{children:[O.jsxs(M5u,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[O.jsxs(sYn,{color:"primary",value:v,size:"small",exclusive:!0,onChange:j,children:[O.jsx($Yn,{value:"simple",size:"small",children:"Modo simplificado"}),O.jsx($Yn,{value:"advanced",size:"small",children:"Modo avançado"})]}),O.jsx(A.Button,{variant:"outlined",color:"inherit",onClick:P=>b(P),startIcon:!_&&O.jsx(we,{icon:"PLAY_SIMPLE",color:"primary.main"}),children:_?"Voltar":"Executar"}),!!y.open&&O.jsx(m5u,{handleClose:y.onClose,openPopover:y.open,argumentsValues:e,filter:f,onExecute:P=>M(P)})]}),O.jsx(L5u,{children:_?O.jsx(_5u,{fields:n.map(P=>P.name),data:s,isError:l,isLoading:d}):O.jsx(O.Fragment,{children:v==="simple"?O.jsx(j5u,{fieldsSelect:n,sql:f,setSql:g}):O.jsx(g5u,{fieldsSelect:n,argumentsValues:e,onChangeArguments:t,sql:f,setSql:g,setFilterRule:a})})})]})})},xYn=({name:e,helperText:t,onChange:n,tabIndex:a,...r})=>{const{control:u}=Re.useFormContext();return O.jsx(Re.Controller,{name:e,control:u,render:({field:c,fieldState:{error:s}})=>O.jsxs("div",{children:[O.jsx(A.FormControlLabel,{control:O.jsx(A.Switch,{...c,checked:c.value,onChange:(l,d)=>{c.onChange(l),n&&n(l,d)},inputProps:{tabIndex:a}}),...r}),(!!s||t)&&O.jsx(A.FormHelperText,{error:!!s,sx:l=>({mx:"14px",color:r.disabled?l.palette.grey[500]:void 0}),children:s?s==null?void 0:s.message:t})]})})},E5u=[{label:"JSON",value:"JSON"},{label:"XML",value:"XML"},{label:"BINÁRIO",value:"BYTEA"}],k5u=[{label:"PUT",value:"PUT"},{label:"POST",value:"POST"},{label:"GET",value:"GET"},{label:"DELETE",value:"DELETE"}],S5u=A.styled(A.Stack)(({theme:e})=>({border:`1px solid ${A.alpha(e.palette.primary.main,.3)}`,backgroundColor:A.alpha(e.palette.primary.main,.05),flexDirection:"row",alignItems:"center",padding:10,gap:10,borderRadius:8,marginBottom:8,svg:{color:e.palette.primary.main}})),D5u=A.styled(A.IconButton)(({theme:e})=>({svg:{color:`${e.palette.primary.main} !important`}})),I5u=A.styled(A.IconButton)(()=>({height:"38px",alignSelf:"center"})),B5u=({webhookData:e,isEditing:t=!1,haveTip:n=!1})=>{const{control:a}=Re.useFormContext(),{fields:r,append:u,remove:c}=Re.useFieldArray({name:"headers",control:a}),s=()=>{u({value:"",name:""})};return O.jsxs(O.Fragment,{children:[n&&O.jsxs(S5u,{children:[O.jsx(we,{icon:"INFO_CIRCLE"}),O.jsx(A.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&&O.jsx(pn,{name:"name",label:"Nome do webhook"}),O.jsxs(A.Stack,{direction:"row",gap:2,children:[O.jsx(pn,{name:"url",label:"URL de endpoint",rules:{required:{value:!0,message:"Url é obrigatório"}}}),O.jsx(pn,{name:"filter",label:"Filtro"})]}),t&&e&&O.jsxs(O.Fragment,{children:[O.jsx(pn,{variant:"filled",name:"solution",label:"Solução",disabled:!0}),O.jsxs(A.Stack,{direction:"row",gap:2,children:[O.jsx(pn,{variant:"filled",name:"resource",label:"Origem",disabled:!0}),O.jsx(pn,{variant:"filled",name:"resourceID",label:"ID origem",disabled:!0,InputProps:{endAdornment:O.jsx(A.InputAdornment,{position:"end",children:O.jsx(D5u,{onClick:()=>navigator.clipboard.writeText(e.resourceID),children:O.jsx(we,{className:"copyIcon",icon:"COPY_CONTENT"})})})}}),O.jsx(pn,{variant:"filled",name:"event",label:"Evento",disabled:!0})]})]}),O.jsxs(A.Stack,{direction:"row",gap:2,children:[O.jsxs(A.Stack,{width:"35%",gap:2,children:[O.jsx(A.Typography,{color:"text.secondary",variant:"overline",children:"Tipo de conteúdo:"}),O.jsx(IWn,{name:"content_type",options:E5u,row:!0,decorated:!0})]}),O.jsxs(A.Stack,{gap:2,children:[O.jsx(A.Typography,{color:"text.secondary",variant:"overline",children:"Métodos Http:"}),O.jsx(IWn,{name:"http_method",options:k5u,row:!0,decorated:!0})]})]}),O.jsx(A.Typography,{color:"text.secondary",variant:"overline",children:"Status:"}),O.jsx(xYn,{name:"active",label:"Ativo"}),O.jsx(A.Typography,{color:"text.secondary",variant:"overline",children:"Cabeçalho:"}),r==null?void 0:r.map((l,d)=>O.jsxs(A.Stack,{direction:"row",gap:2,children:[O.jsx(pn,{name:`headers.${d}.name`,label:"Chave",rules:{required:{value:!0,message:"Chave é obrigatório"}}}),O.jsx(pn,{name:`headers.${d}.value`,label:"Valor",rules:{required:{value:!0,message:"Valor é obrigatório"}}}),O.jsx(I5u,{onClick:()=>c(d),color:"error",children:O.jsx(we,{icon:"DELETE_MARK_BUTTON_02"})})]},l.id)),O.jsx(EDn,{actionType:"NEW",size:"large",variant:"outlined",color:"inherit",fullWidth:!0,onClick:()=>s(),children:"Adicionar novo cabeçalho"}),O.jsx(A.Divider,{})]})},AYn=({name:e,helperText:t,rules:n,...a})=>{const{control:r}=Re.useFormContext();return O.jsx(Re.Controller,{name:e,control:r,rules:n,render:({field:{name:u,onChange:c,value:s,ref:l},fieldState:{error:d}})=>O.jsx(lWn,{ref:l,...a,name:u,value:s,error:!!d,helperText:(d==null?void 0:d.message)||t,onChange:({target:{value:f}})=>c(f)})})},W5u=({name:e,containerProps:t,required:n,rules:a,tabIndex:r})=>{const u=`${e}.zipCode`,c=`${e}.publicPlace`,s=`${e}.number`,l=`${e}.district`,d=`${e}.complement`,f=`${e}.state`,g=`${e}.city`,_=m=>{m.key==="Enter"&&m.preventDefault()};return O.jsxs(A.Stack,{gap:1.5,...t,children:[O.jsxs(A.Stack,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[O.jsx(AYn,{name:u,label:"CEP",mask:[{mask:"00000-000"}],InputProps:{endAdornment:O.jsx(A.InputAdornment,{position:"end",children:O.jsx(A.CircularProgress,{size:24})})},rules:a,onKeyDown:_,required:n,sx:{width:"auto",flex:1,minWidth:160},tabIndex:r}),O.jsxs(A.Stack,{direction:{xs:"column",sm:"row"},gap:1.5,flex:{xs:1,md:"1 1 50%"},children:[O.jsx(pn,{name:c,label:"Logradouro",onKeyDown:_,inputProps:{maxLength:70},sx:{width:"auto",minWidth:250,flex:1},tabIndex:r}),O.jsx(pn,{name:s,label:"Número",onKeyDown:_,inputProps:{maxLength:6},sx:{width:"auto",minWidth:100},tabIndex:r})]})]}),O.jsxs(A.Stack,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[O.jsx(pn,{name:l,label:"Bairro",onKeyDown:_,inputProps:{maxLength:20},sx:{width:"auto",flex:{xs:1,md:"1 1 100px"}},tabIndex:r}),O.jsx(pn,{name:d,label:"Complemento",onKeyDown:_,inputProps:{maxLength:30},sx:{minWidth:200,width:"auto",flex:{xs:1,md:"1 1 500px"}},tabIndex:r})]}),O.jsxs(A.Stack,{gap:1.5,flexWrap:"wrap",direction:{xs:"column",sm:"row"},children:[O.jsx(oZ,{name:f,label:"Estado",options:[],disabled:!0,required:n,sx:{flex:1},tabIndex:r}),O.jsx(pn,{name:g,label:"Cidade",disabled:!0,required:n,sx:{flex:1},tabIndex:r})]})]})},$5u=({name:e,rules:t,helperText:n,...a})=>{const{control:r}=Re.useFormContext();return O.jsx(Re.Controller,{name:e,control:r,rules:t,render:({field:u,fieldState:{error:c}})=>O.jsx($Dn,{...u,...a,onChange:s=>{u.onChange(s)},error:!!c,helperText:(c==null?void 0:c.message)||n})})},x5u=({name:e,rules:t,helperText:n,tabIndex:a,...r})=>{const{control:u}=Re.useFormContext();return O.jsx(Re.Controller,{name:e,control:u,rules:t,render:({field:c,fieldState:{error:s}})=>O.jsxs("div",{children:[O.jsx(A.FormControlLabel,{control:O.jsx(A.Checkbox,{...c,checked:c.value,tabIndex:a}),...r}),(!!s||n)&&O.jsx(A.FormHelperText,{error:!!s,children:s?s==null?void 0:s.message:n})]})})},A5u=({row:e,name:t,rules:n,label:a,options:r,spacing:u,helperText:c,required:s,...l})=>{const{control:d}=Re.useFormContext(),f=(g,_)=>g.includes(_)?g.filter(m=>m!==_):[...g,_];return O.jsx(Re.Controller,{name:t,control:d,rules:n,render:({field:{value:g=[],..._},fieldState:{error:m}})=>O.jsxs(A.FormControl,{component:"fieldset",children:[a&&O.jsx(A.FormLabel,{component:"legend",sx:{typography:"body2"},required:s,children:a}),O.jsx(A.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(v=>O.jsx(A.FormControlLabel,{control:O.jsx(A.Checkbox,{checked:g.includes(v.value),onChange:()=>_.onChange(f(g,v.value))}),label:v.label,...l},v.value))}),(!!m||c)&&O.jsx(A.FormHelperText,{error:!!m,sx:v=>({color:l.disabled?v.palette.grey[500]:void 0}),children:m?m==null?void 0:m.message:c})]})})},R5u=({keyName:e,inputs:t=[],rules:n,tabIndex:a,...r})=>{const u=o.useRef(null),{control:c,setValue:s,formState:{errors:l}}=Re.useFormContext(),d=_=>{const m=_.clipboardData.getData("text").split("");t.map((v,h)=>s(v,m[h])),_.preventDefault()},f=(_,m)=>{const{maxLength:v,value:h,name:C}=_.target,p=C.replace(e,""),y=Number(p),S=document.querySelector(`input[name=${e}${y+1}]`);h.length>v&&(_.target.value=h[0]),h.length>=v&&y<6&&S!==null&&S.focus(),m(_)};nIn("paste",d,u);const g=t.some(_=>l[_]);return O.jsxs(A.Stack,{children:[O.jsx(A.Stack,{direction:"row",spacing:2,justifyContent:"center",ref:u,children:t.map((_,m)=>O.jsx(Re.Controller,{name:`${e}${m+1}`,control:c,rules:n,render:({field:v,fieldState:{error:h}})=>O.jsx(A.TextField,{...r,...v,autoComplete:"none",error:!!h,autoFocus:m===0,placeholder:"-",onChange:C=>{f(C,v.onChange)},onFocus:C=>C.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&&O.jsx(A.FormHelperText,{error:!0,sx:{px:2},children:"Código é obrigatório"})]})},z5u=({name:e,rules:t,helperText:n,...a})=>{const{control:r}=Re.useFormContext();return O.jsx(Re.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,...s},fieldState:{error:l}})=>O.jsx($Zn,{...s,onChangeColor:c,inputRef:u,fullWidth:!0,error:!!l,helperText:(l==null?void 0:l.message)||n,...a})})},H5u=({name:e,rules:t,tabIndex:n,helperText:a,required:r,...u})=>{const{control:c}=Re.useFormContext();return O.jsx(Re.Controller,{name:e,control:c,rules:t,render:({field:{ref:s,...l},fieldState:{error:d}})=>{var f;return O.jsx(_Z.DatePicker,{inputRef:s,format:"dd/MM/yyyy",localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",...u.localeText},...l,...u,value:l.value?new Date(l.value):null,slotProps:{textField:{...(f=u.slotProps)==null?void 0:f.textField,required:r,error:!!d,helperText:(d==null?void 0:d.message)||a,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})},V5u=({name:e,label:t,rules:n,tabIndex:a,helperText:r,required:u,...c})=>{const{control:s,setError:l}=Re.useFormContext();return O.jsx(Re.Controller,{name:e,control:s,rules:n,render:({field:{value:d,onChange:f},fieldState:{error:g}})=>O.jsx(_Z.DateRangePicker,{format:"dd/MM/yyyy",localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",...c.localeText},value:[(d==null?void 0:d.startDate)||null,(d==null?void 0:d.endDate)||null],onChange:_=>f({startDate:_[0],endDate:_[1]}),onError:_=>{l(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}})})},F5u=({name:e,rules:t,tabIndex:n,helperText:a,required:r,...u})=>{const{control:c}=Re.useFormContext();return O.jsx(Re.Controller,{name:e,control:c,rules:t,render:({field:{ref:s,...l},fieldState:{error:d}})=>{var f;return O.jsx(_Z.DateTimePicker,{format:"dd/MM/yyyy HH:mm",inputRef:s,localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",...u.localeText},...l,...u,value:l.value?new Date(l.value):null,slotProps:{textField:{...(f=u.slotProps)==null?void 0:f.textField,required:r,error:!!d,helperText:(d==null?void 0:d.message)||a,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})},N5u=({id:e,children:t,onSubmit:n,methods:a,...r})=>O.jsx(Re.FormProvider,{...a,children:O.jsx(A.Stack,{component:"form",id:e,onSubmit:n,flex:1,width:1,noValidate:!0,...r,children:t})}),T5u=({name:e,helperText:t,rules:n,...a})=>{const{control:r}=Re.useFormContext();return O.jsx(Re.Controller,{name:e,control:r,rules:n,render:({field:{ref:u,value:c,...s},fieldState:{error:l}})=>O.jsx(aWn,{value:c,inputRef:u,fullWidth:!0,error:!!l,helperText:(l==null?void 0:l.message)||t,...a,...s,name:e})})},Z5u=({name:e,label:t="",rules:n,helperText:a,changed:r,...u})=>{const{control:c}=Re.useFormContext();return O.jsx(Re.Controller,{name:e,control:c,rules:n,render:({field:s,fieldState:{error:l}})=>O.jsx(A.Autocomplete,{...s,onChange:(d,f)=>{r&&r(f),s.onChange(f)},renderInput:d=>O.jsx(A.TextField,{label:t,error:!!l,helperText:l?l==null?void 0:l.message:a,...d}),...u})})},U5u=({name:e,helperText:t,rules:n,onChange:a,...r})=>{const{control:u}=Re.useFormContext();return O.jsx(Re.Controller,{name:e,control:u,rules:n,render:({field:c,fieldState:{error:s}})=>O.jsx(xbt,{...c,onChange:l=>{c.onChange(l),a&&a(l)},fullWidth:!0,error:!!s,helperText:(s==null?void 0:s.message)||t,...r})})},G5u=({name:e,sx:t,rules:n,passwordSize:a,specialCharacter:r,upperCaseChar:u,numberChar:c,showErrorMessage:s,match:l,...d})=>{const{watch:f}=Re.useFormContext(),g=f(e),[_,m]=o.useState(!1),{hasNumberChar:v,hasSpecialCharacter:h,hasUpperCaseChar:C,isLengthValid:p}=Vbt(g,a,c,r,u);return O.jsx(pn,{...d,name:e,type:_?"text":"password",InputProps:{endAdornment:O.jsx(A.InputAdornment,{position:"end",children:O.jsx(A.IconButton,{onClick:()=>m(!_),edge:"end","aria-label":"Mostrar/Ocultar senha",children:O.jsx(we,{icon:_?"VIEW_ON":"VIEW_OFF"})})})},rules:{...n,validate:{...n==null?void 0:n.validate,validationPassword:y=>{const S=Vbt(y,a,c,r,u);return!S.hasNumberChar||!S.hasSpecialCharacter||!S.hasUpperCaseChar||!S.isLengthValid?"Senha inválida":l&&l.fieldPassword&&f(l.fieldPassword)!==y?"As senhas devem ser iguais":!0}}},sx:{...t,"& .MuiFormHelperText-root":{display:(!h||!C||!p||!v)&&!s?"none":void 0}}})},IWn=({name:e,rules:t,row:n,label:a,options:r,spacing:u,helperText:c,decorated:s,onChange:l,tabIndex:d,required:f,disabled:g,..._})=>{const{control:m}=Re.useFormContext(),v=a?`${e}-${a}`:"";return O.jsx(Re.Controller,{name:e,control:m,rules:t,render:({field:h,fieldState:{error:C}})=>O.jsxs(A.FormControl,{component:"fieldset",sx:{...s&&{paddingLeft:1.5}},children:[a&&O.jsx(A.FormLabel,{component:"legend",id:v,sx:{typography:"body2"},required:f,children:a}),O.jsx(A.RadioGroup,{..._,...h,onChange:(p,y)=>{h.onChange(p),l&&l(p,y)},"aria-labelledby":v,row:n,children:r.map(p=>O.jsx(A.FormControlLabel,{value:p.value,control:O.jsx(A.Radio,{inputProps:{tabIndex:d},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}},...s&&{border:`1px solid ${A.alpha(y.grey[500],.32)}`,borderRadius:1,padding:.25,paddingRight:(u||0)/2||1,...h.value===p.value&&{borderColor:"primary.main",backgroundColor:A.alpha(y.primary.main,.05)}}})},p.value))}),(!!C||c)&&O.jsx(A.FormHelperText,{error:!!C,sx:p=>({color:g?p.palette.grey[500]:void 0}),children:C?C==null?void 0:C.message:c})]})})},K5u=({name:e,rules:t,tabIndex:n,helperText:a,required:r,...u})=>{const{control:c}=Re.useFormContext();return O.jsx(Re.Controller,{name:e,control:c,rules:t,render:({field:{ref:s,...l},fieldState:{error:d}})=>{var f;return O.jsx(_Z.TimePicker,{ampm:!1,format:"HH:mm",inputRef:s,localeText:{fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",...u.localeText},...l,...u,value:l.value?new Date(l.value):null,slotProps:{textField:{...(f=u.slotProps)==null?void 0:f.textField,error:!!d,required:r,helperText:(d==null?void 0:d.message)||a,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})},Y5u=({onFileCropped:e,onImageUploaded:t,onCancel:n,aspect:a,label:r,image:u="",uploading:c,file:s,tabIndex:l,...d})=>{const{id:f,setCropModalOpen:g,handleRemove:_,cropModalOpen:m,cancelChanges:v,saveChanges:h,previewImage:C,setCropper:p,preview:y,closePreviewImage:S}=iYn({onFileCropped:e,onImageUploaded:t,onCancel:n});return O.jsxs(O.Fragment,{children:[O.jsxs(A.Stack,{position:"relative",alignItems:"center",justifyContent:"center",children:[c&&O.jsx(clu,{}),O.jsx(aYn,{...d,id:f,file:s,onDrop:w=>{if(w.length>0){g(!0);const j=new FileReader;j.addEventListener("load",()=>{var M;const b=((M=j.result)==null?void 0:M.toString())||"";t(b),e(void 0)}),j.readAsDataURL(w[0])}},image:u,tabIndex:l})]}),O.jsx(oYn,{id:f,open:m,onClose:v,label:r,aspectRatio:a,imageSrc:u,onRemove:_,onSave:h,onPreview:C,onInitialized:p}),O.jsx(A.Dialog,{open:!!y,onClose:S,scroll:"body",PaperProps:{sx:{p:2}},children:y&&O.jsx("img",{src:y,alt:"Preview"})})]})};function RYn(e,t){const{watch:n,setValue:a}=Re.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(v=>v!==_);a(e,m)},file:r,setFileValue:u}}const X5u=({name:e,rules:t,helperText:n,aspect:a,label:r,image:u,onFileCropped:c,onImageUploaded:s,onCancel:l,...d})=>{const{control:f}=Re.useFormContext(),{uploadFile:g,file:_,setFileValue:m}=RYn(e);return O.jsx(Re.Controller,{name:e,control:f,rules:t,render:({field:{value:v},fieldState:{error:h}})=>O.jsx(Y5u,{accept:{"image/*":[]},file:v?_:void 0,onFileCropped:C=>{g(C),c&&c(C)},onImageUploaded:s,onCancel:()=>{m(void 0),l&&l()},error:!!h,disableMultiple:!0,helperText:(!!h||n)&&O.jsx(A.FormHelperText,{error:!!h,sx:{px:2},children:h?h==null?void 0:h.message:n}),aspect:a,label:r,image:u,...d})})},Q5u=({name:e,rules:t,helperText:n,aspect:a,label:r,image:u,onFileCropped:c,onImageUploaded:s,onCancel:l,...d})=>{const{control:f}=Re.useFormContext(),{uploadFile:g,file:_,setFileValue:m}=RYn(e);return O.jsx(Re.Controller,{name:e,control:f,rules:t,render:({field:{value:v},fieldState:{error:h}})=>O.jsx(uYn,{accept:{"image/*":[]},file:v?_:void 0,onFileCropped:C=>{g(C),c&&c(C)},onImageUploaded:s,onCancel:()=>{m(void 0),l&&l()},error:!!h,disableMultiple:!0,helperText:(!!h||n)&&O.jsx(A.FormHelperText,{error:!!h,sx:{px:2},children:h?h==null?void 0:h.message:n}),aspect:a,label:r,image:u,...d})})},zYn=A.styled(A.Button)(({theme:e})=>({borderColor:e.palette.grey[300]})),HYn=A.styled(A.Box)(({theme:e})=>({border:"1.5px solid",borderColor:e.palette.grey[300],height:450,width:"40%",borderRadius:8})),J5u=({selectedItems:e,items:t,loading:n,searchText:a,onAdd:r,onRemove:u,search:c,itemsTitle:s,selectedItemsTitle:l,additionalContent:d,enableSearchInSelectedItems:f,onSearch:g})=>{const[_,m]=o.useState(""),v=A.debounce(g,400),h=t.filter(E=>!e.some(L=>L.id===E.id)),C=e.filter(E=>{var L;return(L=E.name)==null?void 0:L.toLowerCase().includes(_.toLowerCase())}),p=f?C:t.filter(E=>e.some(L=>L.id===E.id)),[y,S]=o.useState([]),[w,j]=o.useState([]),b=()=>{r(y),S([])},M=()=>{u(w),j([])},P=E=>{j(E?p:[])},k=E=>{S(E?h:[])},W=(E,L)=>{j(L?B=>[...B,E]:B=>B.filter($=>$.id!==E.id))},I=(E,L)=>{S(L?B=>[...B,E]:B=>B.filter($=>$.id!==E.id))},D=E=>{E.key==="Enter"&&E.preventDefault()};return O.jsx(A.Stack,{children:O.jsxs(A.Stack,{direction:"row",alignItems:"center",gap:3,children:[O.jsx(HYn,{display:"flex",flex:1,children:O.jsxs(A.Stack,{flex:1,children:[O.jsxs(A.Stack,{direction:"row",gap:1,padding:2,children:[O.jsx(A.Checkbox,{size:"small",indeterminate:y.length>0&&y.length!==h.length,checked:y.length>0&&y.length===h.length,onChange:E=>k(E.target.checked)}),O.jsxs(A.Stack,{children:[O.jsx(A.Typography,{variant:"subtitle2",color:"text.primary",children:`${s} cadastrados(as)`}),O.jsx(A.Typography,{variant:"caption",color:"text.disabled",children:`${y.length}/${h.length} selecionados`})]})]}),O.jsx(A.Divider,{}),O.jsxs(A.Stack,{p:2,flex:1,children:[O.jsxs(A.Stack,{direction:"row",gap:1,children:[O.jsx(Fle,{iconPosition:"start",placeholder:"Buscar",onKeyDown:D,size:"small",fullWidth:!0,trigger:"change",onSearch:E=>v(E)}),d]}),O.jsx(sWn,{isLoading:n,loading:O.jsx(A.Stack,{alignItems:"center",justifyContent:"center",flex:1,children:O.jsx(A.CircularProgress,{})}),isEmpty:h.length===0,empty:O.jsx(uvt,{text:c?`Nenhum ${a} encontrado`:`Nenhum ${a} disponível`,sx:{svg:{height:140}}}),children:O.jsx(ZT,{sx:{maxHeight:280},children:h.map(E=>O.jsxs(A.Stack,{gap:1,marginTop:"8px",children:[O.jsxs(A.Stack,{direction:"row",gap:.5,alignItems:"center",marginTop:"8px",children:[O.jsx(A.Checkbox,{size:"small",checked:y.includes(E),onChange:L=>I(E,L.target.checked)}),E.label]}),O.jsx(A.Divider,{})]},E.id))})})]})]})}),O.jsxs(A.Stack,{gap:3,children:[O.jsx(zYn,{variant:"outlined",onClick:b,children:O.jsx(we,{icon:"ARROW_RIGHT_SIMPLE"})}),O.jsx(zYn,{variant:"outlined",onClick:M,children:O.jsx(we,{icon:"ARROW_LEFT_SIMPLE"})})]}),O.jsx(HYn,{display:"flex",flex:1,children:O.jsxs(A.Stack,{flex:1,children:[O.jsxs(A.Stack,{direction:"row",gap:1,padding:2,children:[O.jsx(A.Checkbox,{size:"small",indeterminate:w.length>0&&w.length!==p.length,checked:w.length>0&&w.length===p.length,onChange:E=>P(E.target.checked)}),O.jsxs(A.Stack,{children:[O.jsx(A.Typography,{variant:"subtitle2",color:"text.primary",children:`${l} selecionados(as)`}),O.jsx(A.Typography,{variant:"caption",color:"text.disabled",children:`${w.length}/${p.length} selecionados`})]})]}),O.jsx(A.Divider,{}),O.jsxs(A.Stack,{p:2,gap:1,children:[f&&O.jsx(Fle,{iconPosition:"start",placeholder:"Buscar",size:"small",fullWidth:!0,trigger:"change",onSearch:E=>m(E??""),onKeyDown:D}),O.jsx(sWn,{isLoading:n,loading:O.jsx(A.Stack,{alignItems:"center",justifyContent:"center",flex:1,children:O.jsx(A.CircularProgress,{})}),isEmpty:p.length===0,empty:O.jsx(uvt,{text:_?`Nenhum ${a} encontrado`:`Nenhum ${a} selecionado`,sx:{svg:{height:140},marginTop:"56px",backgroundColor:"transparent"}}),children:O.jsx(ZT,{sx:{maxHeight:280},children:p.map(E=>O.jsxs(A.Stack,{gap:1,children:[O.jsxs(A.Stack,{direction:"row",gap:.5,alignItems:"center",marginTop:"8px",children:[O.jsx(A.Checkbox,{size:"small",checked:w.includes(E),onChange:L=>W(E,L.target.checked)}),E.label]}),O.jsx(A.Divider,{})]},E.id))})})]})]})})]})})},q5u=Object.freeze(Object.defineProperty({__proto__:null,default:yrr},Symbol.toStringTag,{value:"Module"}));ee.ActionButton=EDn,ee.Address=W5u,ee.AdvancedRule=P5u,ee.Autocomplete=BDn,ee.AutocompleteDetailed=$Dn,ee.AutocompleteDetailedField=$5u,ee.AutocompleteField=oZ,ee.BuilderLayout=qBo,ee.BuilderSidebar=LHo,ee.Carousel=iDo,ee.CarouselArrowIndex=ODo,ee.CarouselArrows=sDo,ee.CarouselDots=lDo,ee.Checkbox=x5u,ee.Codes=R5u,ee.ColorPickerField=z5u,ee.ColorPickerInput=$Zn,ee.Common=z1u,ee.CommonSSR=V1u,ee.Confirm=F1u,ee.CustomAvatar=WDn,ee.CustomAvatarGroup=IFn,ee.DataGrid=CBn,ee.DatePicker=H5u,ee.DateRangePicker=V5u,ee.DateTimePicker=F5u,ee.Delayed=Z1u,ee.DialogAnimate=Urr,ee.Drawer=niu,ee.EmptyContent=qHn,ee.EmptyView=uvt,ee.Error=aiu,ee.ExpandableGroup=BYn,ee.FabButtonAnimate=rzn,ee.Field=pn,ee.FilterRule=xlu,ee.FixedProgressBar=Obt,ee.Form=N5u,ee.FrameSkeleton=Plu,ee.HelpButton=xDn,ee.Icon=we,ee.IconButtonAnimate=azn,ee.Iconify=OGn,ee.IllustrationEmptyContent=wxn,ee.ImageCrop=tKn,ee.Incrementer=aWn,ee.IncrementerField=T5u,ee.Label=iWn,ee.Lightbox=wBo,ee.ListingRules=Hlu,ee.LoadingScreen=Iuu,ee.ManualRule=Alu,ee.MaskedInput=lWn,ee.MaskedInputField=AYn,ee.MaterialDesignContent=qpt,ee.MenuPopover=wKn,ee.Modal=MKn,ee.ModalActions=quu,ee.MotionContainer=oar,ee.MotionLazyContainer=Tpt,ee.MotionViewport=iar,ee.MultiCheckbox=A5u,ee.MultipleChipField=Z5u,ee.NoData=Mxn,ee.NumberInput=xbt,ee.NumberInputField=U5u,ee.PasswordField=G5u,ee.PasswordRules=i2u,ee.PopoverSelect=glu,ee.Portal=LKn,ee.RadioGroupField=IWn,ee.Result=sWn,ee.SavedChanges=P2u,ee.Scrollbar=ZT,ee.SearchInput=Fle,ee.SeoPreview=Blu,ee.SnackbarContent=Jpt,ee.SnackbarProvider=Dzn,ee.SplashScreen=E2u,ee.Steps=D2u,ee.StyledTab=I2u,ee.StyledTabs=B2u,ee.Summary=hlu,ee.SwapList=J5u,ee.Switch=xYn,ee.TRANSITION=Lxn,ee.TabPanel=W2u,ee.TableEmptyRows=kDo,ee.TableHeadCustom=DDo,ee.TableNoData=PDo,ee.TablePaginationCustom=BDo,ee.TableSelectedAction=IDo,ee.TableSkeleton=EDo,ee.TextAnimate=Grr,ee.TextMaxLine=Wj,ee.ThemeProvider=WUn,ee.TimePicker=K5u,ee.ToggleButtonGroup=sYn,ee.Transition=Nht,ee.Upload=rYn,ee.UploadAvatar=aYn,ee.UploadAvatarWithCropField=X5u,ee.UploadBox=ilu,ee.UploadIllustration=jxn,ee.UploadWithCrop=uYn,ee.UploadWithCropField=Q5u,ee.Webhook=B5u,ee.WhiteBox=cYn,ee.color=Cau,ee.compare=dHo,ee.cssStyles=yDo,ee.emptyRows=jDo,ee.file=o2u,ee.formatNumber=ouu,ee.formatTime=C2u,ee.generateQuery=EKn,ee.getComparator=wDo,ee.loadable=L2u,ee.mask=w2u,ee.number=euu,ee.routes=y2u,ee.sort=j2u,ee.useActiveElement=eWo,ee.useApiMessage=pHo,ee.useCarousel=oDo,ee.useCopyToClipboard=tWo,ee.useDatagrid=zFn,ee.useDeepCompareEffect=_Ho,ee.useEventListener=nIn,ee.useIsMounting=vHo,ee.useLightBox=PBo,ee.useOffSetTop=yHo,ee.useOnClickOutside=bHo,ee.usePagination=CHo,ee.usePopover=Amt,ee.useResponsive=Npt,ee.useSnackbar=Izn,ee.useTable=MDo,ee.useTabs=hHo,ee.useToggle=xmt,ee.uuidv4=M2u,ee.validators=n2u,ee.varBgColor=lqn,ee.varBgKenburns=sqn,ee.varBgPan=fqn,ee.varBounce=oqn,ee.varContainer=_ht,ee.varFade=mse,ee.varFlip=rqn,ee.varHover=cqn,ee.varPath=eqn,ee.varRotate=uqn,ee.varScale=iqn,ee.varSlide=aqn,ee.varTranEnter=Xe,ee.varTranExit=at,ee.varTranHover=tqn,ee.varZoom=nqn,Object.defineProperty(ee,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.3.94",
4
+ "version": "1.3.96",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",