@data-c/ui 0.0.149-alpha.0 → 0.0.150-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ Valid keys: `+JSON.stringify(Object.keys(m),null," "));var re=ae(O,$,_,M,F+"."+
6
6
  `)),()=>{})}function At(t){return Ke(t,"spacing",8,"spacing")}function Oe(t,e){if(typeof e=="string"||e==null)return e;let r=Math.abs(e),n=t(r);return e>=0?n:typeof n=="number"?-n:`-${n}`}function yu(t,e){return r=>t.reduce((n,o)=>(n[o]=Oe(e,r),n),{})}function xu(t,e,r,n){if(e.indexOf(r)===-1)return null;let o=gu(r),i=yu(o,n),s=t[r];return ie(t,s,i)}function Un(t,e){let r=At(t.theme);return Object.keys(t).map(n=>xu(t,e,n,r)).reduce(Ue,{})}function J(t){return Un(t,Sr)}J.propTypes=process.env.NODE_ENV!=="production"?Sr.reduce((t,e)=>(t[e]=Te,t),{}):{};J.filterProps=Sr;function Q(t){return Un(t,Pr)}Q.propTypes=process.env.NODE_ENV!=="production"?Pr.reduce((t,e)=>(t[e]=Te,t),{}):{};Q.filterProps=Pr;function Mi(t){return Un(t,Vn)}Mi.propTypes=process.env.NODE_ENV!=="production"?Vn.reduce((t,e)=>(t[e]=Te,t),{}):{};Mi.filterProps=Vn;function qn(t=8){if(t.mui)return t;let e=At({spacing:t}),r=(...n)=>(process.env.NODE_ENV!=="production"&&(n.length<=4||console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${n.length}`)),(n.length===0?[1]:n).map(i=>{let s=e(i);return typeof s=="number"?`${s}px`:s}).join(" "));return r.mui=!0,r}function bu(...t){let e=t.reduce((n,o)=>(o.filterProps.forEach(i=>{n[i]=o}),n),{}),r=n=>Object.keys(n).reduce((o,i)=>e[i]?Ue(o,e[i](n)):o,{});return r.propTypes=process.env.NODE_ENV!=="production"?t.reduce((n,o)=>Object.assign(n,o.propTypes),{}):{},r.filterProps=t.reduce((n,o)=>n.concat(o.filterProps),[]),r}var qe=bu;function xe(t){return typeof t!="number"?t:`${t}px solid`}function Ce(t,e){return Z({prop:t,themeKey:"borders",transform:e})}var vu=Ce("border",xe),Tu=Ce("borderTop",xe),Cu=Ce("borderRight",xe),Su=Ce("borderBottom",xe),Pu=Ce("borderLeft",xe),Eu=Ce("borderColor"),wu=Ce("borderTopColor"),_u=Ce("borderRightColor"),ku=Ce("borderBottomColor"),Fu=Ce("borderLeftColor"),Ou=Ce("outline",xe),Au=Ce("outlineColor"),Mt=t=>{if(t.borderRadius!==void 0&&t.borderRadius!==null){let e=Ke(t.theme,"shape.borderRadius",4,"borderRadius"),r=n=>({borderRadius:Oe(e,n)});return ie(t,t.borderRadius,r)}return null};Mt.propTypes=process.env.NODE_ENV!=="production"?{borderRadius:Te}:{};Mt.filterProps=["borderRadius"];var py=qe(vu,Tu,Cu,Su,Pu,Eu,wu,_u,ku,Fu,Mt,Ou,Au);var Dt=t=>{if(t.gap!==void 0&&t.gap!==null){let e=Ke(t.theme,"spacing",8,"gap"),r=n=>({gap:Oe(e,n)});return ie(t,t.gap,r)}return null};Dt.propTypes=process.env.NODE_ENV!=="production"?{gap:Te}:{};Dt.filterProps=["gap"];var Rt=t=>{if(t.columnGap!==void 0&&t.columnGap!==null){let e=Ke(t.theme,"spacing",8,"columnGap"),r=n=>({columnGap:Oe(e,n)});return ie(t,t.columnGap,r)}return null};Rt.propTypes=process.env.NODE_ENV!=="production"?{columnGap:Te}:{};Rt.filterProps=["columnGap"];var $t=t=>{if(t.rowGap!==void 0&&t.rowGap!==null){let e=Ke(t.theme,"spacing",8,"rowGap"),r=n=>({rowGap:Oe(e,n)});return ie(t,t.rowGap,r)}return null};$t.propTypes=process.env.NODE_ENV!=="production"?{rowGap:Te}:{};$t.filterProps=["rowGap"];var Mu=Z({prop:"gridColumn"}),Du=Z({prop:"gridRow"}),Ru=Z({prop:"gridAutoFlow"}),$u=Z({prop:"gridAutoColumns"}),Bu=Z({prop:"gridAutoRows"}),Iu=Z({prop:"gridTemplateColumns"}),Lu=Z({prop:"gridTemplateRows"}),ju=Z({prop:"gridTemplateAreas"}),Nu=Z({prop:"gridArea"}),by=qe(Dt,Rt,$t,Mu,Du,Ru,$u,Bu,Iu,Lu,ju,Nu);function He(t,e){return e==="grey"?e:t}var zu=Z({prop:"color",themeKey:"palette",transform:He}),Vu=Z({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:He}),Uu=Z({prop:"backgroundColor",themeKey:"palette",transform:He}),Sy=qe(zu,Vu,Uu);function me(t){return t<=1&&t!==0?`${t*100}%`:t}var qu=Z({prop:"width",transform:me}),Er=t=>{if(t.maxWidth!==void 0&&t.maxWidth!==null){let e=r=>{var n,o;let i=((n=t.theme)==null||(n=n.breakpoints)==null||(n=n.values)==null?void 0:n[r])||Tr[r];return i?((o=t.theme)==null||(o=o.breakpoints)==null?void 0:o.unit)!=="px"?{maxWidth:`${i}${t.theme.breakpoints.unit}`}:{maxWidth:i}:{maxWidth:me(r)}};return ie(t,t.maxWidth,e)}return null};Er.filterProps=["maxWidth"];var Wu=Z({prop:"minWidth",transform:me}),Yu=Z({prop:"height",transform:me}),Gu=Z({prop:"maxHeight",transform:me}),Ku=Z({prop:"minHeight",transform:me}),ky=Z({prop:"size",cssProperty:"width",transform:me}),Fy=Z({prop:"size",cssProperty:"height",transform:me}),Hu=Z({prop:"boxSizing"}),Oy=qe(qu,Er,Wu,Yu,Gu,Ku,Hu);var Zu={border:{themeKey:"borders",transform:xe},borderTop:{themeKey:"borders",transform:xe},borderRight:{themeKey:"borders",transform:xe},borderBottom:{themeKey:"borders",transform:xe},borderLeft:{themeKey:"borders",transform:xe},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:xe},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Mt},color:{themeKey:"palette",transform:He},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:He},backgroundColor:{themeKey:"palette",transform:He},p:{style:Q},pt:{style:Q},pr:{style:Q},pb:{style:Q},pl:{style:Q},px:{style:Q},py:{style:Q},padding:{style:Q},paddingTop:{style:Q},paddingRight:{style:Q},paddingBottom:{style:Q},paddingLeft:{style:Q},paddingX:{style:Q},paddingY:{style:Q},paddingInline:{style:Q},paddingInlineStart:{style:Q},paddingInlineEnd:{style:Q},paddingBlock:{style:Q},paddingBlockStart:{style:Q},paddingBlockEnd:{style:Q},m:{style:J},mt:{style:J},mr:{style:J},mb:{style:J},ml:{style:J},mx:{style:J},my:{style:J},margin:{style:J},marginTop:{style:J},marginRight:{style:J},marginBottom:{style:J},marginLeft:{style:J},marginX:{style:J},marginY:{style:J},marginInline:{style:J},marginInlineStart:{style:J},marginInlineEnd:{style:J},marginBlock:{style:J},marginBlockStart:{style:J},marginBlockEnd:{style:J},displayPrint:{cssProperty:!1,transform:t=>({"@media print":{display:t}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Dt},rowGap:{style:$t},columnGap:{style:Rt},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:me},maxWidth:{style:Er},minWidth:{transform:me},height:{transform:me},maxHeight:{transform:me},minHeight:{transform:me},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},pt=Zu;function Xu(...t){let e=t.reduce((n,o)=>n.concat(Object.keys(o)),[]),r=new Set(e);return t.every(n=>r.size===Object.keys(n).length)}function Ju(t,e){return typeof t=="function"?t(e):t}function Qu(){function t(r,n,o,i){let s={[r]:n,theme:o},l=i[r];if(!l)return{[r]:n};let{cssProperty:a=r,themeKey:u,transform:d,style:c}=l;if(n==null)return null;if(u==="typography"&&n==="inherit")return{[r]:n};let p=ft(o,u)||{};return c?c(s):ie(s,n,g=>{let x=Ot(p,d,g);return g===x&&typeof g=="string"&&(x=Ot(p,d,`${r}${g==="default"?"":ye(g)}`,g)),a===!1?x:{[a]:x}})}function e(r){var n;let{sx:o,theme:i={}}=r||{};if(!o)return null;let s=(n=i.unstable_sxConfig)!=null?n:pt;function l(a){let u=a;if(typeof a=="function")u=a(i);else if(typeof a!="object")return a;if(!u)return null;let d=jn(i.breakpoints),c=Object.keys(d),p=d;return Object.keys(u).forEach(f=>{let g=Ju(u[f],i);if(g!=null)if(typeof g=="object")if(s[f])p=Ue(p,t(f,g,i,s));else{let x=ie({theme:i},g,w=>({[f]:w}));Xu(x,g)?p[f]=e({sx:g,theme:i}):p=Ue(p,x)}else p=Ue(p,t(f,g,i,s))}),Nn(c,p)}return Array.isArray(o)?o.map(l):l(o)}return e}var Di=Qu();Di.filterProps=["sx"];var Bt=Di;var ec=["breakpoints","palette","spacing","shape"];function tc(t={},...e){let{breakpoints:r={},palette:n={},spacing:o,shape:i={}}=t,s=ge(t,ec),l=Ln(r),a=qn(o),u=de({breakpoints:l,direction:"ltr",components:{},palette:B({mode:"light"},n),spacing:a,shape:B({},ki,i)},s);return u=e.reduce((d,c)=>de(d,c),u),u.unstable_sxConfig=B({},pt,s==null?void 0:s.unstable_sxConfig),u.unstable_sx=function(c){return Bt({sx:c,theme:this})},u}var Ze=tc;function rc(t){return Object.keys(t).length===0}function nc(t=null){let e=Ri.useContext(_react2.ThemeContext);return!e||rc(e)?t:e}var $i=nc;var oc=Ze();function ic(t=oc){return $i(t)}var Bi=ic;var sc=["sx"],ac=t=>{var e,r;let n={systemProps:{},otherProps:{}},o=(e=t==null||(r=t.theme)==null?void 0:r.unstable_sxConfig)!=null?e:pt;return Object.keys(t).forEach(i=>{o[i]?n.systemProps[i]=t[i]:n.otherProps[i]=t[i]}),n};function wr(t){let{sx:e}=t,r=ge(t,sc),{systemProps:n,otherProps:o}=ac(r),i;return Array.isArray(e)?i=[n,...e]:typeof e=="function"?i=(...s)=>{let l=e(...s);return be(l)?B({},n,l):n}:i=B({},n,e),B({},o,{sx:i})}function Ii(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(r=Ii(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function lc(){for(var t,e,r=0,n="",o=arguments.length;r<o;r++)(t=arguments[r])&&(e=Ii(t))&&(n&&(n+=" "),n+=e);return n}var Li=lc;var uc=["variant"];function ji(t){return t.length===0}function _r(t){let{variant:e}=t,r=ge(t,uc),n=e||"";return Object.keys(r).sort().forEach(o=>{o==="color"?n+=ji(n)?t[o]:ye(t[o]):n+=`${ji(n)?o:ye(o)}${ye(t[o].toString())}`}),n}var cc=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function fc(t){return Object.keys(t).length===0}function pc(t){return typeof t=="string"&&t.charCodeAt(0)>96}var dc=(t,e)=>e.components&&e.components[t]&&e.components[t].styleOverrides?e.components[t].styleOverrides:null,Fr=t=>{let e=0,r={};return t&&t.forEach(n=>{let o="";typeof n.props=="function"?(o=`callback${e}`,e+=1):o=_r(n.props),r[o]=n.style}),r},mc=(t,e)=>{let r=[];return e&&e.components&&e.components[t]&&e.components[t].variants&&(r=e.components[t].variants),Fr(r)},Or=(t,e,r)=>{let{ownerState:n={}}=t,o=[],i=0;return r&&r.forEach(s=>{let l=!0;if(typeof s.props=="function"){let a=B({},t,n);l=s.props(a)}else Object.keys(s.props).forEach(a=>{n[a]!==s.props[a]&&t[a]!==s.props[a]&&(l=!1)});l&&(typeof s.props=="function"?o.push(e[`callback${i}`]):o.push(e[_r(s.props)])),typeof s.props=="function"&&(i+=1)}),o},hc=(t,e,r,n)=>{var o;let i=r==null||(o=r.components)==null||(o=o[n])==null?void 0:o.variants;return Or(t,e,i)};function Wn(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}var gc=Ze(),Ni=t=>t&&t.charAt(0).toLowerCase()+t.slice(1);function kr({defaultTheme:t,theme:e,themeId:r}){return fc(e)?t:e[r]||e}function yc(t){return t?(e,r)=>r[t]:null}var zi=({styledArg:t,props:e,defaultTheme:r,themeId:n})=>{let o=t(B({},e,{theme:kr(B({},e,{defaultTheme:r,themeId:n}))})),i;if(o&&o.variants&&(i=o.variants,delete o.variants),i){let s=Or(e,Fr(i),i);return[o,...s]}return o};function Yn(t={}){let{themeId:e,defaultTheme:r=gc,rootShouldForwardProp:n=Wn,slotShouldForwardProp:o=Wn}=t,i=s=>Bt(B({},s,{theme:kr(B({},s,{defaultTheme:r,themeId:e}))}));return i.__mui_systemSx=!0,(s,l={})=>{xi(s,P=>P.filter(D=>!(D!=null&&D.__mui_systemSx)));let{name:a,slot:u,skipVariantsResolver:d,skipSx:c,overridesResolver:p=yc(Ni(u))}=l,f=ge(l,cc),g=d!==void 0?d:u&&u!=="Root"&&u!=="root"||!1,x=c||!1,w;process.env.NODE_ENV!=="production"&&a&&(w=`${a}-${Ni(u||"Root")}`);let A=Wn;u==="Root"||u==="root"?A=n:u?A=o:pc(s)&&(A=void 0);let j=Dn(s,B({shouldForwardProp:A,label:w},f)),ee=(P,...D)=>{let te=D?D.map(v=>{if(typeof v=="function"&&v.__emotion_real!==v)return b=>zi({styledArg:v,props:b,defaultTheme:r,themeId:e});if(be(v)){let b=v,k;return v&&v.variants&&(k=v.variants,delete b.variants,b=m=>{let h=v;return Or(m,Fr(k),k).forEach(E=>{h=de(h,E)}),h}),b}return v}):[],K=P;if(be(P)){let v;P&&P.variants&&(v=P.variants,delete K.variants,K=b=>{let k=P;return Or(b,Fr(v),v).forEach(h=>{k=de(k,h)}),k})}else typeof P=="function"&&P.__emotion_real!==P&&(K=v=>zi({styledArg:P,props:v,defaultTheme:r,themeId:e}));a&&p&&te.push(v=>{let b=kr(B({},v,{defaultTheme:r,themeId:e})),k=dc(a,b);if(k){let m={};return Object.entries(k).forEach(([h,S])=>{m[h]=typeof S=="function"?S(B({},v,{theme:b})):S}),p(v,m)}return null}),a&&!g&&te.push(v=>{let b=kr(B({},v,{defaultTheme:r,themeId:e}));return hc(v,mc(a,b),b,a)}),x||te.push(i);let Y=te.length-D.length;if(Array.isArray(P)&&Y>0){let v=new Array(Y).fill("");K=[...P,...v],K.raw=[...P.raw,...v]}let W=j(K,...te);if(process.env.NODE_ENV!=="production"){let v;a&&(v=`${a}${ye(u||"")}`),v===void 0&&(v=`Styled(${vr(s)})`),W.displayName=v}return s.muiName&&(W.muiName=s.muiName),W};return j.withConfig&&(ee.withConfig=j.withConfig),ee}}var xc=Yn(),Vi=xc;function Gn(t){let{theme:e,name:r,props:n}=t;return!e||!e.components||!e.components[r]||!e.components[r].defaultProps?n:_t(e.components[r].defaultProps,n)}function Ar({props:t,name:e,defaultTheme:r,themeId:n}){let o=Bi(r);return n&&(o=o[n]||o),Gn({theme:o,name:e,props:t})}var G=Ye(lr());var X=Ye(lr());var bc=["component","direction","spacing","divider","children","className","useFlexGap"],Tc=Ze(),Cc=Vi("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root});function Sc(t){return Ar({props:t,name:"MuiStack",defaultTheme:Tc})}function Pc(t,e){let r=dt.Children.toArray(t).filter(Boolean);return r.reduce((n,o,i)=>(n.push(o),i<r.length-1&&n.push(dt.cloneElement(e,{key:`separator-${i}`})),n),[])}var Ec=t=>({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[t],wc=({ownerState:t,theme:e})=>{let r=B({display:"flex",flexDirection:"column"},ie({theme:e},Cr({values:t.direction,breakpoints:e.breakpoints.values}),n=>({flexDirection:n})));if(t.spacing){let n=At(e),o=Object.keys(e.breakpoints.values).reduce((a,u)=>((typeof t.spacing=="object"&&t.spacing[u]!=null||typeof t.direction=="object"&&t.direction[u]!=null)&&(a[u]=!0),a),{}),i=Cr({values:t.direction,base:o}),s=Cr({values:t.spacing,base:o});typeof i=="object"&&Object.keys(i).forEach((a,u,d)=>{if(!i[a]){let p=u>0?i[d[u-1]]:"column";i[a]=p}}),r=de(r,ie({theme:e},s,(a,u)=>t.useFlexGap?{gap:Oe(n,a)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${Ec(u?i[u]:t.direction)}`]:Oe(n,a)}}))}return r=Oi(e.breakpoints,r),r};function Kn(t={}){let{createStyledComponent:e=Cc,useThemeProps:r=Sc,componentName:n="MuiStack"}=t,o=()=>kt({root:["root"]},a=>Ft(n,a),{}),i=e(wc),s=dt.forwardRef(function(a,u){let d=r(a),c=wr(d),{component:p="div",direction:f="column",spacing:g=0,divider:x,children:w,className:A,useFlexGap:j=!1}=c,ee=ge(c,bc),P={direction:f,spacing:g,useFlexGap:j},D=o();return _jsxruntime.jsx.call(void 0, i,B({as:p,ownerState:P,ref:u,className:Li(D.root,A)},ee,{children:x?Pc(w,x):w}))});return process.env.NODE_ENV!=="production"&&(s.propTypes={children:X.default.node,direction:X.default.oneOfType([X.default.oneOf(["column-reverse","column","row-reverse","row"]),X.default.arrayOf(X.default.oneOf(["column-reverse","column","row-reverse","row"])),X.default.object]),divider:X.default.node,spacing:X.default.oneOfType([X.default.arrayOf(X.default.oneOfType([X.default.number,X.default.string])),X.default.number,X.default.object,X.default.string]),sx:X.default.oneOfType([X.default.arrayOf(X.default.oneOfType([X.default.func,X.default.object,X.default.bool])),X.default.func,X.default.object])}),s}var Ui=Kn();process.env.NODE_ENV!=="production"&&(Ui.propTypes={children:G.default.node,component:G.default.elementType,direction:G.default.oneOfType([G.default.oneOf(["column-reverse","column","row-reverse","row"]),G.default.arrayOf(G.default.oneOf(["column-reverse","column","row-reverse","row"])),G.default.object]),divider:G.default.node,spacing:G.default.oneOfType([G.default.arrayOf(G.default.oneOfType([G.default.number,G.default.string])),G.default.number,G.default.object,G.default.string]),sx:G.default.oneOfType([G.default.arrayOf(G.default.oneOfType([G.default.func,G.default.object,G.default.bool])),G.default.func,G.default.object]),useFlexGap:G.default.bool});var Mr=Ui;var Oc=_styled2.default.call(void 0, (0, _material.Typography))(({theme:t})=>({fontWeight:"bold"}));function Yi(t){let{label:e,children:r,labelProps:n,contentProps:o,isNumber:i,showDivider:s}=t;return _jsxruntime.jsxs.call(void 0, _material.Box,{sx:{display:"flex",gap:4},children:[_jsxruntime.jsxs.call(void 0, _material.Box,{children:[_jsxruntime.jsx.call(void 0, Mr,{children:_jsxruntime.jsx.call(void 0, Oc,N(y({},n),{children:e}))}),_jsxruntime.jsx.call(void 0, Mr,{direction:i?"row":"column",justifyContent:i?"flex-end":"center",children:r})]}),s&&_jsxruntime.jsx.call(void 0, _material.Divider,{orientation:"vertical",flexItem:!0})]})}function Zi(t){let{title:e,children:r,onBack:n,onClose:o,onUpdate:i}=t,[s,l]=_react.useState.call(void 0, !1),[a,u]=_react.useState.call(void 0, "");_react.useEffect.call(void 0, ()=>{u(e)},[e]);let d=_material.useMediaQuery.call(void 0, c=>c.breakpoints.down("sm"));return _jsxruntime.jsxs.call(void 0, _material.Box,{sx:{display:"flex",flexDirection:d||o?"column":"row",justifyContent:"space-between",alignContent:"center",alignItems:"center",gap:2,marginBottom:2},children:[_jsxruntime.jsxs.call(void 0, _material.Box,{sx:{display:"flex",alignItems:"center",flexDirection:"row"},children:[n&&_jsxruntime.jsx.call(void 0, _material.IconButton,{sx:{mr:1},onClick:n,children:_jsxruntime.jsx.call(void 0, _iconsmaterial.ArrowBack,{})}),i&&!s&&_jsxruntime.jsxs.call(void 0, _material.Stack,{direction:"row",alignItems:"center",spacing:1,children:[_jsxruntime.jsx.call(void 0, _material.Typography,{component:"h1",variant:"h4",sx:{fontWeight:"500"},children:a}),_jsxruntime.jsx.call(void 0, _material.IconButton,{onClick:()=>{l(!0)},children:_jsxruntime.jsx.call(void 0, _iconsmaterial.Edit,{})})]}),s&&_jsxruntime.jsx.call(void 0, _material.TextField,{autoFocus:!0,value:a,onKeyDown:c=>{c.key==="Enter"&&(i&&i(a),l(!1)),c.key==="Escape"&&(u(e),l(!1))},onChange:c=>{let p=c.target.value;u(p)}}),!i&&_jsxruntime.jsx.call(void 0, _material.Typography,{component:"h1",variant:"h4",sx:{fontWeight:"500"},children:e})]}),o&&_jsxruntime.jsx.call(void 0, _material.IconButton,{sx:{marginLeft:"auto"},onClick:o,children:_jsxruntime.jsx.call(void 0, _iconsmaterial.Close,{fontSize:"medium"})}),r]})}var _lodash = require('lodash'); var _lodash2 = _interopRequireDefault(_lodash);function Rr(t){let i=t,{onSearch:e}=i,r=H(i,["onSearch"]),n=_lodash2.default.debounce(s=>e(s),500);function o(s){let l=s.target.value;n(l)}return _jsxruntime.jsx.call(void 0, _material.TextField,y({onChange:o,autoFocus:!0,InputProps:{startAdornment:_jsxruntime.jsx.call(void 0, _material.InputAdornment,{position:"start",children:_jsxruntime.jsx.call(void 0, _iconsmaterial.Search,{})})}},r))}function eo(t){let b=t,{value:e,label:r,options:n,isLoading:o,form:i,table:s,tableProps:l,onChange:a,onSearch:u,renderValue:d,dialogProps:c,disabled:p,filterOptions:f,optionKeyName:g}=b,x=H(b,["value","label","options","isLoading","form","table","tableProps","onChange","onSearch","renderValue","dialogProps","disabled","filterOptions","optionKeyName"]),{isOpen:w,openDialog:A,closeDialog:j}=_hooks.useDialog.call(void 0, ),[ee,P]=_react.useState.call(void 0, null),D=i||Ri.default.Fragment,te=_lodash2.default.debounce(k=>u(k),500),K=_react.useCallback.call(void 0, (k,m)=>ue(this,null,function*(){te(m)}),[te]),Y=_react.useCallback.call(void 0, (k,m,h)=>{if(g&&(m!=null&&m[g].includes("Adicionar op\xE7\xE3o:"))){let S=m[g].replace("Adicionar op\xE7\xE3o:","").trim().replace(/["']/g,""),E=N(y({},m),{[g]:S});a&&a(E);return}a&&a(m)},[a]);function W(k,m=!1,h=!1){var S;if(k){let E=Ri.default.Children.toArray((S=k.props)==null?void 0:S.children),_=E.length===1?0:1;return E.splice(_,0,_jsxruntime.jsx.call(void 0, _material.IconButton,{sx:{padding:"2px"},size:"small",color:"default",onClick:()=>A(),disabled:h,children:_jsxruntime.jsx.call(void 0, _iconsmaterial.SearchOutlined,{fontSize:"small"})})),m&&E.unshift(_jsxruntime.jsx.call(void 0, _material.IconButton,{disabled:!0,children:_jsxruntime.jsx.call(void 0, _material.CircularProgress,{color:"primary",size:18})})),Ri.default.cloneElement(k,{},E)}return k}function v(k,m){if(!g)return k;let S=_material.createFilterOptions.call(void 0, )(k,m),{inputValue:E}=m,_=k.some(M=>E===M[g]);return E!==""&&!_&&S.push({[g]:`Adicionar op\xE7\xE3o: "${E}"`}),S}return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, _material.Autocomplete,{disabled:p,loadingText:"Carregando...",loading:o,onChange:Y,value:e,onInputChange:K,options:n,getOptionLabel:d,filterOptions:v,renderInput:k=>_jsxruntime.jsx.call(void 0, _material.TextField,y(N(y({label:r,onDoubleClick:()=>{p||A()}},k),{InputProps:N(y({},k.InputProps),{endAdornment:W(k.InputProps.endAdornment,o,p)}),disabled:p}),x)),clearIcon:_jsxruntime.jsx.call(void 0, _iconsmaterial.BackspaceOutlined,{}),componentsProps:{clearIndicator:{sx:{visibility:"visible"}}},noOptionsText:"Nenhum registro"}),_jsxruntime.jsx.call(void 0, _providers.FormProvider,{children:_jsxruntime.jsx.call(void 0, we,N(y({open:w,onClose:()=>j(),actions:"none"},c),{children:_jsxruntime.jsxs.call(void 0, _material.Stack,{spacing:1,children:[_jsxruntime.jsxs.call(void 0, _material.Stack,{direction:"row",justifyContent:"flex-end",alignItems:"center",spacing:1,children:[_jsxruntime.jsx.call(void 0, Rr,{placeholder:"Pesquisar",onSearch:k=>P(k)}),i&&_jsxruntime.jsx.call(void 0, D,{})]}),_jsxruntime.jsx.call(void 0, s,y({query:ee,enableTransporter:!0,onTransport:k=>{j(),a&&a(k)}},l))]})}))})]})}var Jc={dialogProps:{maxWidth:"md",fullWidth:!0}};eo.defaultProps=Jc;function to(t){let{label:e}=t;return _jsxruntime.jsx.call(void 0, _material.Stack,{component:"header",sx:{alignItems:"center",gap:1},children:_jsxruntime.jsx.call(void 0, _material.Typography,{component:"h1",variant:"h3",sx:{fontWeight:"medium",color:r=>r.palette.grey[600]},children:e})})}var _axios = require('axios');var Pe=Ye(ss()),It=Ye(us()),hs=Ye(fs()),vf=Object.prototype.toString,Tf=Error.prototype.toString,Cf=RegExp.prototype.toString,Sf=typeof Symbol!="undefined"?Symbol.prototype.toString:()=>"",Pf=/^Symbol\((.*)\)(.*)$/;function Ef(t){return t!=+t?"NaN":t===0&&1/t<0?"-0":""+t}function ps(t,e=!1){if(t==null||t===!0||t===!1)return""+t;let r=typeof t;if(r==="number")return Ef(t);if(r==="string")return e?`"${t}"`:t;if(r==="function")return"[Function "+(t.name||"anonymous")+"]";if(r==="symbol")return Sf.call(t).replace(Pf,"Symbol($1)");let n=vf.call(t).slice(8,-1);return n==="Date"?isNaN(t.getTime())?""+t:t.toISOString(t):n==="Error"||t instanceof Error?"["+Tf.call(t)+"]":n==="RegExp"?Cf.call(t):null}function $e(t,e){let r=ps(t,e);return r!==null?r:JSON.stringify(t,function(n,o){let i=ps(this[n],e);return i!==null?i:o},2)}function gs(t){return t==null?[]:[].concat(t)}var ys,wf=/\$\{\s*(\w+)\s*\}/g;ys=Symbol.toStringTag;var ce=class extends Error{static formatError(e,r){let n=r.label||r.path||"this";return n!==r.path&&(r=Object.assign({},r,{path:n})),typeof e=="string"?e.replace(wf,(o,i)=>$e(r[i])):typeof e=="function"?e(r):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,r,n,o,i){super(),this.value=void 0,this.path=void 0,this.type=void 0,this.errors=void 0,this.params=void 0,this.inner=void 0,this[ys]="Error",this.name="ValidationError",this.value=r,this.path=n,this.type=o,this.errors=[],this.inner=[],gs(e).forEach(s=>{if(ce.isError(s)){this.errors.push(...s.errors);let l=s.inner.length?s.inner:[s];this.inner.push(...l)}else this.errors.push(s)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],!i&&Error.captureStackTrace&&Error.captureStackTrace(this,ce)}},Ae={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:t,type:e,value:r,originalValue:n})=>{let o=n!=null&&n!==r?` (cast from the value \`${$e(n,!0)}\`).`:".";return e!=="mixed"?`${t} must be a \`${e}\` type, but the final value was: \`${$e(r,!0)}\``+o:`${t} must match the configured type. The validated value was: \`${$e(r,!0)}\``+o}},_e={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},We={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},lo={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},uo={isValue:"${path} field must be ${value}"},co={noUnknown:"${path} field has unspecified keys: ${unknown}"},Lr={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},xs={notType:t=>{let{path:e,value:r,spec:n}=t,o=n.types.length;if(Array.isArray(r)){if(r.length<o)return`${e} tuple value has too few items, expected a length of ${o} but got ${r.length} for value: \`${$e(r,!0)}\``;if(r.length>o)return`${e} tuple value has too many items, expected a length of ${o} but got ${r.length} for value: \`${$e(r,!0)}\``}return ce.formatError(Ae.notType,t)}},tv=Object.assign(Object.create(null),{mixed:Ae,string:_e,number:We,date:lo,object:co,array:Lr,boolean:uo,tuple:xs}),Gr=t=>t&&t.__isYupSchema__,gt=class{static fromOptions(e,r){if(!r.then&&!r.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:n,then:o,otherwise:i}=r,s=typeof n=="function"?n:(...l)=>l.every(a=>a===n);return new gt(e,(l,a)=>{var u;let d=s(...l)?o:i;return(u=d==null?void 0:d(a))!=null?u:a})}constructor(e,r){this.fn=void 0,this.refs=e,this.refs=e,this.fn=r}resolve(e,r){let n=this.refs.map(i=>i.getValue(r==null?void 0:r.value,r==null?void 0:r.parent,r==null?void 0:r.context)),o=this.fn(n,e,r);if(o===void 0||o===e)return e;if(!Gr(o))throw new TypeError("conditions must return a schema object");return o.resolve(r)}},Ir={context:"$",value:"."};var Be=class{constructor(e,r={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof e!="string")throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===Ir.context,this.isValue=this.key[0]===Ir.value,this.isSibling=!this.isContext&&!this.isValue;let n=this.isContext?Ir.context:this.isValue?Ir.value:"";this.path=this.key.slice(n.length),this.getter=this.path&&(0,Pe.getter)(this.path,!0),this.map=r.map}getValue(e,r,n){let o=this.isContext?n:this.isValue?e:r;return this.getter&&(o=this.getter(o||{})),this.map&&(o=this.map(o)),o}cast(e,r){return this.getValue(e,r==null?void 0:r.parent,r==null?void 0:r.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}};Be.prototype.__isYupRef=!0;var ke=t=>t==null;function mt(t){function e({value:r,path:n="",options:o,originalValue:i,schema:s},l,a){let{name:u,test:d,params:c,message:p,skipAbsent:f}=t,{parent:g,context:x,abortEarly:w=s.spec.abortEarly,disableStackTrace:A=s.spec.disableStackTrace}=o;function j(b){return Be.isRef(b)?b.getValue(r,g,x):b}function ee(b={}){var k;let m=Object.assign({value:r,originalValue:i,label:s.spec.label,path:b.path||n,spec:s.spec},c,b.params);for(let S of Object.keys(m))m[S]=j(m[S]);let h=new ce(ce.formatError(b.message||p,m),r,m.path,b.type||u,(k=b.disableStackTrace)!=null?k:A);return h.params=m,h}let P=w?l:a,D={path:n,parent:g,type:u,from:o.from,createError:ee,resolve:j,options:o,originalValue:i,schema:s},te=b=>{ce.isError(b)?P(b):b?a(null):P(ee())},K=b=>{ce.isError(b)?P(b):l(b)};if(f&&ke(r))return te(!0);let W;try{var v;if(W=d.call(D,r,D),typeof((v=W)==null?void 0:v.then)=="function"){if(o.sync)throw new Error(`Validation test of type: "${D.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(W).then(te,K)}}catch(b){K(b);return}te(W)}return e.OPTIONS=t,e}function _f(t,e,r,n=r){let o,i,s;return e?((0,Pe.forEach)(e,(l,a,u)=>{let d=a?l.slice(1,l.length-1):l;t=t.resolve({context:n,parent:o,value:r});let c=t.type==="tuple",p=u?parseInt(d,10):0;if(t.innerType||c){if(c&&!u)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${s}" must contain an index to the tuple element, e.g. "${s}[0]"`);if(r&&p>=r.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${l}, in the path: ${e}. because there is no value at that index. `);o=r,r=r&&r[p],t=c?t.spec.types[p]:t.innerType}if(!u){if(!t.fields||!t.fields[d])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${s} which is a type: "${t.type}")`);o=r,r=r&&r[d],t=t.fields[d]}i=d,s=a?"["+l+"]":"."+l}),{schema:t,parent:o,parentPath:i}):{parent:o,parentPath:e,schema:t}}var yt=class extends Set{describe(){let e=[];for(let r of this.values())e.push(Be.isRef(r)?r.describe():r);return e}resolveAll(e){let r=[];for(let n of this.values())r.push(e(n));return r}clone(){return new yt(this.values())}merge(e,r){let n=this.clone();return e.forEach(o=>n.add(o)),r.forEach(o=>n.delete(o)),n}};function ht(t,e=new Map){if(Gr(t)||!t||typeof t!="object")return t;if(e.has(t))return e.get(t);let r;if(t instanceof Date)r=new Date(t.getTime()),e.set(t,r);else if(t instanceof RegExp)r=new RegExp(t),e.set(t,r);else if(Array.isArray(t)){r=new Array(t.length),e.set(t,r);for(let n=0;n<t.length;n++)r[n]=ht(t[n],e)}else if(t instanceof Map){r=new Map,e.set(t,r);for(let[n,o]of t.entries())r.set(n,ht(o,e))}else if(t instanceof Set){r=new Set,e.set(t,r);for(let n of t)r.add(ht(n,e))}else if(t instanceof Object){r={},e.set(t,r);for(let[n,o]of Object.entries(t))r[n]=ht(o,e)}else throw Error(`Unable to clone ${t}`);return r}var se=class{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new yt,this._blacklist=new yt,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Ae.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e==null?void 0:e.spec),this.withMutation(r=>{r.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;let r=Object.create(Object.getPrototypeOf(this));return r.type=this.type,r._typeCheck=this._typeCheck,r._whitelist=this._whitelist.clone(),r._blacklist=this._blacklist.clone(),r.internalTests=Object.assign({},this.internalTests),r.exclusiveTests=Object.assign({},this.exclusiveTests),r.deps=[...this.deps],r.conditions=[...this.conditions],r.tests=[...this.tests],r.transforms=[...this.transforms],r.spec=ht(Object.assign({},this.spec,e)),r}label(e){let r=this.clone();return r.spec.label=e,r}meta(...e){if(e.length===0)return this.spec.meta;let r=this.clone();return r.spec.meta=Object.assign(r.spec.meta||{},e[0]),r}withMutation(e){let r=this._mutate;this._mutate=!0;let n=e(this);return this._mutate=r,n}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let r=this,n=e.clone(),o=Object.assign({},r.spec,n.spec);return n.spec=o,n.internalTests=Object.assign({},r.internalTests,n.internalTests),n._whitelist=r._whitelist.merge(e._whitelist,e._blacklist),n._blacklist=r._blacklist.merge(e._blacklist,e._whitelist),n.tests=r.tests,n.exclusiveTests=r.exclusiveTests,n.withMutation(i=>{e.tests.forEach(s=>{i.test(s.OPTIONS)})}),n.transforms=[...r.transforms,...n.transforms],n}isType(e){return e==null?!!(this.spec.nullable&&e===null||this.spec.optional&&e===void 0):this._typeCheck(e)}resolve(e){let r=this;if(r.conditions.length){let n=r.conditions;r=r.clone(),r.conditions=[],r=n.reduce((o,i)=>i.resolve(o,e),r),r=r.resolve(e)}return r}resolveOptions(e){var r,n,o,i;return Object.assign({},e,{from:e.from||[],strict:(r=e.strict)!=null?r:this.spec.strict,abortEarly:(n=e.abortEarly)!=null?n:this.spec.abortEarly,recursive:(o=e.recursive)!=null?o:this.spec.recursive,disableStackTrace:(i=e.disableStackTrace)!=null?i:this.spec.disableStackTrace})}cast(e,r={}){let n=this.resolve(Object.assign({value:e},r)),o=r.assert==="ignore-optionality",i=n._cast(e,r);if(r.assert!==!1&&!n.isType(i)){if(o&&ke(i))return i;let s=$e(e),l=$e(i);throw new TypeError(`The value of ${r.path||"field"} could not be cast to a value that satisfies the schema type: "${n.type}".
7
7
 
8
8
  attempted value: ${s}
9
- `+(l!==s?`result of cast: ${l}`:""))}return i}_cast(e,r){let n=e===void 0?e:this.transforms.reduce((o,i)=>i.call(this,o,e,this),e);return n===void 0&&(n=this.getDefault(r)),n}_validate(e,r={},n,o){let{path:i,originalValue:s=e,strict:l=this.spec.strict}=r,a=e;l||(a=this._cast(a,Object.assign({assert:!1},r)));let u=[];for(let d of Object.values(this.internalTests))d&&u.push(d);this.runTests({path:i,value:a,originalValue:s,options:r,tests:u},n,d=>{if(d.length)return o(d,a);this.runTests({path:i,value:a,originalValue:s,options:r,tests:this.tests},n,o)})}runTests(e,r,n){let o=!1,{tests:i,value:s,originalValue:l,path:a,options:u}=e,d=x=>{o||(o=!0,r(x,s))},c=x=>{o||(o=!0,n(x,s))},p=i.length,f=[];if(!p)return c([]);let g={value:s,originalValue:l,path:a,options:u,schema:this};for(let x=0;x<i.length;x++){let w=i[x];w(g,d,function(j){j&&(Array.isArray(j)?f.push(...j):f.push(j)),--p<=0&&c(f)})}}asNestedTest({key:e,index:r,parent:n,parentPath:o,originalParent:i,options:s}){let l=e!=null?e:r;if(l==null)throw TypeError("Must include `key` or `index` for nested validations");let a=typeof l=="number",u=n[l],d=Object.assign({},s,{strict:!0,parent:n,value:u,originalValue:i[l],key:void 0,[a?"index":"key"]:l,path:a||l.includes(".")?`${o||""}[${u?l:`"${l}"`}]`:(o?`${o}.`:"")+e});return(c,p,f)=>this.resolve(d)._validate(u,d,p,f)}validate(e,r){var n;let o=this.resolve(Object.assign({},r,{value:e})),i=(n=r==null?void 0:r.disableStackTrace)!=null?n:o.spec.disableStackTrace;return new Promise((s,l)=>o._validate(e,r,(a,u)=>{ce.isError(a)&&(a.value=u),l(a)},(a,u)=>{a.length?l(new ce(a,u,void 0,void 0,i)):s(u)}))}validateSync(e,r){var n;let o=this.resolve(Object.assign({},r,{value:e})),i,s=(n=r==null?void 0:r.disableStackTrace)!=null?n:o.spec.disableStackTrace;return o._validate(e,Object.assign({},r,{sync:!0}),(l,a)=>{throw ce.isError(l)&&(l.value=a),l},(l,a)=>{if(l.length)throw new ce(l,e,void 0,void 0,s);i=a}),i}isValid(e,r){return this.validate(e,r).then(()=>!0,n=>{if(ce.isError(n))return!1;throw n})}isValidSync(e,r){try{return this.validateSync(e,r),!0}catch(n){if(ce.isError(n))return!1;throw n}}_getDefault(e){let r=this.spec.default;return r==null?r:typeof r=="function"?r.call(this,e):ht(r)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,r){let n=this.clone({nullable:e});return n.internalTests.nullable=mt({message:r,name:"nullable",test(o){return o===null?this.schema.spec.nullable:!0}}),n}optionality(e,r){let n=this.clone({optional:e});return n.internalTests.optionality=mt({message:r,name:"optionality",test(o){return o===void 0?this.schema.spec.optional:!0}}),n}optional(){return this.optionality(!0)}defined(e=Ae.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=Ae.notNull){return this.nullability(!1,e)}required(e=Ae.required){return this.clone().withMutation(r=>r.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let r=this.clone();return r.transforms.push(e),r}test(...e){let r;if(e.length===1?typeof e[0]=="function"?r={test:e[0]}:r=e[0]:e.length===2?r={name:e[0],test:e[1]}:r={name:e[0],message:e[1],test:e[2]},r.message===void 0&&(r.message=Ae.default),typeof r.test!="function")throw new TypeError("`test` is a required parameters");let n=this.clone(),o=mt(r),i=r.exclusive||r.name&&n.exclusiveTests[r.name]===!0;if(r.exclusive&&!r.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return r.name&&(n.exclusiveTests[r.name]=!!r.exclusive),n.tests=n.tests.filter(s=>!(s.OPTIONS.name===r.name&&(i||s.OPTIONS.test===o.OPTIONS.test))),n.tests.push(o),n}when(e,r){!Array.isArray(e)&&typeof e!="string"&&(r=e,e=".");let n=this.clone(),o=gs(e).map(i=>new Be(i));return o.forEach(i=>{i.isSibling&&n.deps.push(i.key)}),n.conditions.push(typeof r=="function"?new gt(o,r):gt.fromOptions(o,r)),n}typeError(e){let r=this.clone();return r.internalTests.typeError=mt({message:e,name:"typeError",skipAbsent:!0,test(n){return this.schema._typeCheck(n)?!0:this.createError({params:{type:this.schema.type}})}}),r}oneOf(e,r=Ae.oneOf){let n=this.clone();return e.forEach(o=>{n._whitelist.add(o),n._blacklist.delete(o)}),n.internalTests.whiteList=mt({message:r,name:"oneOf",skipAbsent:!0,test(o){let i=this.schema._whitelist,s=i.resolveAll(this.resolve);return s.includes(o)?!0:this.createError({params:{values:Array.from(i).join(", "),resolved:s}})}}),n}notOneOf(e,r=Ae.notOneOf){let n=this.clone();return e.forEach(o=>{n._blacklist.add(o),n._whitelist.delete(o)}),n.internalTests.blacklist=mt({message:r,name:"notOneOf",test(o){let i=this.schema._blacklist,s=i.resolveAll(this.resolve);return s.includes(o)?this.createError({params:{values:Array.from(i).join(", "),resolved:s}}):!0}}),n}strip(e=!0){let r=this.clone();return r.spec.strip=e,r}describe(e){let r=(e?this.resolve(e):this).clone(),{label:n,meta:o,optional:i,nullable:s}=r.spec;return{meta:o,label:n,optional:i,nullable:s,default:r.getDefault(e),type:r.type,oneOf:r._whitelist.describe(),notOneOf:r._blacklist.describe(),tests:r.tests.map(a=>({name:a.OPTIONS.name,params:a.OPTIONS.params})).filter((a,u,d)=>d.findIndex(c=>c.name===a.name)===u)}}};se.prototype.__isYupSchema__=!0;for(let t of["validate","validateSync"])se.prototype[`${t}At`]=function(e,r,n={}){let{parent:o,parentPath:i,schema:s}=_f(this,e,r,n.context);return s[t](o&&o[i],Object.assign({},n,{parent:o,path:e}))};for(let t of["equals","is"])se.prototype[t]=se.prototype.oneOf;for(let t of["not","nope"])se.prototype[t]=se.prototype.notOneOf;var kf=()=>!0;function Ff(t){return new Nr(t)}var Nr=class extends se{constructor(e){super(typeof e=="function"?{type:"mixed",check:e}:Object.assign({type:"mixed",check:kf},e))}};Ff.prototype=Nr.prototype;function Of(){return new zr}var zr=class extends se{constructor(){super({type:"boolean",check(e){return e instanceof Boolean&&(e=e.valueOf()),typeof e=="boolean"}}),this.withMutation(()=>{this.transform((e,r,n)=>{if(n.spec.coerce&&!n.isType(e)){if(/^(true|1)$/i.test(String(e)))return!0;if(/^(false|0)$/i.test(String(e)))return!1}return e})})}isTrue(e=uo.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"true"},test(r){return ke(r)||r===!0}})}isFalse(e=uo.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"false"},test(r){return ke(r)||r===!1}})}default(e){return super.default(e)}defined(e){return super.defined(e)}optional(){return super.optional()}required(e){return super.required(e)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(e){return super.nonNullable(e)}strip(e){return super.strip(e)}};Of.prototype=zr.prototype;var Af=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Mf=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,Df=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Rf=t=>ke(t)||t===t.trim(),$f={}.toString();function Ie(){return new Vr}var Vr=class extends se{constructor(){super({type:"string",check(e){return e instanceof String&&(e=e.valueOf()),typeof e=="string"}}),this.withMutation(()=>{this.transform((e,r,n)=>{if(!n.spec.coerce||n.isType(e)||Array.isArray(e))return e;let o=e!=null&&e.toString?e.toString():e;return o===$f?e:o})})}required(e){return super.required(e).withMutation(r=>r.test({message:e||Ae.required,name:"required",skipAbsent:!0,test:n=>!!n.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(r=>r.OPTIONS.name!=="required"),e))}length(e,r=_e.length){return this.test({message:r,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(n){return n.length===this.resolve(e)}})}min(e,r=_e.min){return this.test({message:r,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(n){return n.length>=this.resolve(e)}})}max(e,r=_e.max){return this.test({name:"max",exclusive:!0,message:r,params:{max:e},skipAbsent:!0,test(n){return n.length<=this.resolve(e)}})}matches(e,r){let n=!1,o,i;return r&&(typeof r=="object"?{excludeEmptyString:n=!1,message:o,name:i}=r:o=r),this.test({name:i||"matches",message:o||_e.matches,params:{regex:e},skipAbsent:!0,test:s=>s===""&&n||s.search(e)!==-1})}email(e=_e.email){return this.matches(Af,{name:"email",message:e,excludeEmptyString:!0})}url(e=_e.url){return this.matches(Mf,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=_e.uuid){return this.matches(Df,{name:"uuid",message:e,excludeEmptyString:!1})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=_e.trim){return this.transform(r=>r!=null?r.trim():r).test({message:e,name:"trim",test:Rf})}lowercase(e=_e.lowercase){return this.transform(r=>ke(r)?r:r.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>ke(r)||r===r.toLowerCase()})}uppercase(e=_e.uppercase){return this.transform(r=>ke(r)?r:r.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>ke(r)||r===r.toUpperCase()})}};Ie.prototype=Vr.prototype;var Bf=t=>t!=+t;function If(){return new Ur}var Ur=class extends se{constructor(){super({type:"number",check(e){return e instanceof Number&&(e=e.valueOf()),typeof e=="number"&&!Bf(e)}}),this.withMutation(()=>{this.transform((e,r,n)=>{if(!n.spec.coerce)return e;let o=e;if(typeof o=="string"){if(o=o.replace(/\s/g,""),o==="")return NaN;o=+o}return n.isType(o)||o===null?o:parseFloat(o)})})}min(e,r=We.min){return this.test({message:r,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(n){return n>=this.resolve(e)}})}max(e,r=We.max){return this.test({message:r,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(n){return n<=this.resolve(e)}})}lessThan(e,r=We.lessThan){return this.test({message:r,name:"max",exclusive:!0,params:{less:e},skipAbsent:!0,test(n){return n<this.resolve(e)}})}moreThan(e,r=We.moreThan){return this.test({message:r,name:"min",exclusive:!0,params:{more:e},skipAbsent:!0,test(n){return n>this.resolve(e)}})}positive(e=We.positive){return this.moreThan(0,e)}negative(e=We.negative){return this.lessThan(0,e)}integer(e=We.integer){return this.test({name:"integer",message:e,skipAbsent:!0,test:r=>Number.isInteger(r)})}truncate(){return this.transform(e=>ke(e)?e:e|0)}round(e){var r;let n=["ceil","floor","round","trunc"];if(e=((r=e)==null?void 0:r.toLowerCase())||"round",e==="trunc")return this.truncate();if(n.indexOf(e.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+n.join(", "));return this.transform(o=>ke(o)?o:Math[e](o))}};If.prototype=Ur.prototype;var Lf=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function Re(t,e=0){return Number(t)||e}function jf(t){let e=Lf.exec(t);if(!e)return Date.parse?Date.parse(t):Number.NaN;let r={year:Re(e[1]),month:Re(e[2],1)-1,day:Re(e[3],1),hour:Re(e[4]),minute:Re(e[5]),second:Re(e[6]),millisecond:e[7]?Re(e[7].substring(0,3)):0,z:e[8]||void 0,plusMinus:e[9]||void 0,hourOffset:Re(e[10]),minuteOffset:Re(e[11])};if(r.z===void 0&&r.plusMinus===void 0)return new Date(r.year,r.month,r.day,r.hour,r.minute,r.second,r.millisecond).valueOf();let n=0;return r.z!=="Z"&&r.plusMinus!==void 0&&(n=r.hourOffset*60+r.minuteOffset,r.plusMinus==="+"&&(n=0-n)),Date.UTC(r.year,r.month,r.day,r.hour,r.minute+n,r.second,r.millisecond)}var bs=new Date(""),Nf=t=>Object.prototype.toString.call(t)==="[object Date]";function vs(){return new Je}var Je=class extends se{constructor(){super({type:"date",check(e){return Nf(e)&&!isNaN(e.getTime())}}),this.withMutation(()=>{this.transform((e,r,n)=>!n.spec.coerce||n.isType(e)||e===null?e:(e=jf(e),isNaN(e)?Je.INVALID_DATE:new Date(e)))})}prepareParam(e,r){let n;if(Be.isRef(e))n=e;else{let o=this.cast(e);if(!this._typeCheck(o))throw new TypeError(`\`${r}\` must be a Date or a value that can be \`cast()\` to a Date`);n=o}return n}min(e,r=lo.min){let n=this.prepareParam(e,"min");return this.test({message:r,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(o){return o>=this.resolve(n)}})}max(e,r=lo.max){let n=this.prepareParam(e,"max");return this.test({message:r,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(o){return o<=this.resolve(n)}})}};Je.INVALID_DATE=bs;vs.prototype=Je.prototype;vs.INVALID_DATE=bs;function zf(t,e=[]){let r=[],n=new Set,o=new Set(e.map(([s,l])=>`${s}-${l}`));function i(s,l){let a=(0,Pe.split)(s)[0];n.add(a),o.has(`${l}-${a}`)||r.push([l,a])}for(let s of Object.keys(t)){let l=t[s];n.add(s),Be.isRef(l)&&l.isSibling?i(l.path,s):Gr(l)&&"deps"in l&&l.deps.forEach(a=>i(a,s))}return hs.default.array(Array.from(n),r).reverse()}function ds(t,e){let r=1/0;return t.some((n,o)=>{var i;if((i=e.path)!=null&&i.includes(n))return r=o,!0}),r}function Ts(t){return(e,r)=>ds(t,e)-ds(t,r)}var Cs=(t,e,r)=>{if(typeof t!="string")return t;let n=t;try{n=JSON.parse(t)}catch(o){}return r.isType(n)?n:t};function jr(t){if("fields"in t){let e={};for(let[r,n]of Object.entries(t.fields))e[r]=jr(n);return t.setFields(e)}if(t.type==="array"){let e=t.optional();return e.innerType&&(e.innerType=jr(e.innerType)),e}return t.type==="tuple"?t.optional().clone({types:t.spec.types.map(jr)}):"optional"in t?t.optional():t}var Vf=(t,e)=>{let r=[...(0,Pe.normalizePath)(e)];if(r.length===1)return r[0]in t;let n=r.pop(),o=(0,Pe.getter)((0,Pe.join)(r),!0)(t);return!!(o&&n in o)},ms=t=>Object.prototype.toString.call(t)==="[object Object]";function Uf(t,e){let r=Object.keys(t.fields);return Object.keys(e).filter(n=>r.indexOf(n)===-1)}var qf=Ts([]);function Qe(t){return new qr(t)}var qr=class extends se{constructor(e){super({type:"object",check(r){return ms(r)||typeof r=="function"}}),this.fields=Object.create(null),this._sortErrors=qf,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,r={}){var n;let o=super._cast(e,r);if(o===void 0)return this.getDefault(r);if(!this._typeCheck(o))return o;let i=this.fields,s=(n=r.stripUnknown)!=null?n:this.spec.noUnknown,l=[].concat(this._nodes,Object.keys(o).filter(c=>!this._nodes.includes(c))),a={},u=Object.assign({},r,{parent:a,__validating:r.__validating||!1}),d=!1;for(let c of l){let p=i[c],f=c in o;if(p){let g,x=o[c];u.path=(r.path?`${r.path}.`:"")+c,p=p.resolve({value:x,context:r.context,parent:a});let w=p instanceof se?p.spec:void 0,A=w==null?void 0:w.strict;if(w!=null&&w.strip){d=d||c in o;continue}g=!r.__validating||!A?p.cast(o[c],u):o[c],g!==void 0&&(a[c]=g)}else f&&!s&&(a[c]=o[c]);(f!==c in a||a[c]!==o[c])&&(d=!0)}return d?a:o}_validate(e,r={},n,o){let{from:i=[],originalValue:s=e,recursive:l=this.spec.recursive}=r;r.from=[{schema:this,value:s},...i],r.__validating=!0,r.originalValue=s,super._validate(e,r,n,(a,u)=>{if(!l||!ms(u)){o(a,u);return}s=s||u;let d=[];for(let c of this._nodes){let p=this.fields[c];!p||Be.isRef(p)||d.push(p.asNestedTest({options:r,key:c,parent:u,parentPath:r.path,originalParent:s}))}this.runTests({tests:d,value:u,originalValue:s,options:r},n,c=>{o(c.sort(this._sortErrors).concat(a),u)})})}clone(e){let r=super.clone(e);return r.fields=Object.assign({},this.fields),r._nodes=this._nodes,r._excludedEdges=this._excludedEdges,r._sortErrors=this._sortErrors,r}concat(e){let r=super.concat(e),n=r.fields;for(let[o,i]of Object.entries(this.fields)){let s=n[o];n[o]=s===void 0?i:s}return r.withMutation(o=>o.setFields(n,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let r={};return this._nodes.forEach(n=>{var o;let i=this.fields[n],s=e;(o=s)!=null&&o.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[n]})),r[n]=i&&"getDefault"in i?i.getDefault(s):void 0}),r}setFields(e,r){let n=this.clone();return n.fields=e,n._nodes=zf(e,r),n._sortErrors=Ts(Object.keys(e)),r&&(n._excludedEdges=r),n}shape(e,r=[]){return this.clone().withMutation(n=>{let o=n._excludedEdges;return r.length&&(Array.isArray(r[0])||(r=[r]),o=[...n._excludedEdges,...r]),n.setFields(Object.assign(n.fields,e),o)})}partial(){let e={};for(let[r,n]of Object.entries(this.fields))e[r]="optional"in n&&n.optional instanceof Function?n.optional():n;return this.setFields(e)}deepPartial(){return jr(this)}pick(e){let r={};for(let n of e)this.fields[n]&&(r[n]=this.fields[n]);return this.setFields(r,this._excludedEdges.filter(([n,o])=>e.includes(n)&&e.includes(o)))}omit(e){let r=[];for(let n of Object.keys(this.fields))e.includes(n)||r.push(n);return this.pick(r)}from(e,r,n){let o=(0,Pe.getter)(e,!0);return this.transform(i=>{if(!i)return i;let s=i;return Vf(i,e)&&(s=Object.assign({},i),n||delete s[e],s[r]=o(i)),s})}json(){return this.transform(Cs)}noUnknown(e=!0,r=co.noUnknown){typeof e!="boolean"&&(r=e,e=!0);let n=this.test({name:"noUnknown",exclusive:!0,message:r,test(o){if(o==null)return!0;let i=Uf(this.schema,o);return!e||i.length===0||this.createError({params:{unknown:i.join(", ")}})}});return n.spec.noUnknown=e,n}unknown(e=!0,r=co.noUnknown){return this.noUnknown(!e,r)}transformKeys(e){return this.transform(r=>{if(!r)return r;let n={};for(let o of Object.keys(r))n[e(o)]=r[o];return n})}camelCase(){return this.transformKeys(It.camelCase)}snakeCase(){return this.transformKeys(It.snakeCase)}constantCase(){return this.transformKeys(e=>(0,It.snakeCase)(e).toUpperCase())}describe(e){let r=(e?this.resolve(e):this).clone(),n=super.describe(e);n.fields={};for(let[i,s]of Object.entries(r.fields)){var o;let l=e;(o=l)!=null&&o.value&&(l=Object.assign({},l,{parent:l.value,value:l.value[i]})),n.fields[i]=s.describe(l)}return n}};Qe.prototype=qr.prototype;function Wf(t){return new Wr(t)}var Wr=class extends se{constructor(e){super({type:"array",spec:{types:e},check(r){return Array.isArray(r)}}),this.innerType=void 0,this.innerType=e}_cast(e,r){let n=super._cast(e,r);if(!this._typeCheck(n)||!this.innerType)return n;let o=!1,i=n.map((s,l)=>{let a=this.innerType.cast(s,Object.assign({},r,{path:`${r.path||""}[${l}]`}));return a!==s&&(o=!0),a});return o?i:n}_validate(e,r={},n,o){var i;let s=this.innerType,l=(i=r.recursive)!=null?i:this.spec.recursive;r.originalValue!=null&&r.originalValue,super._validate(e,r,n,(a,u)=>{var d;if(!l||!s||!this._typeCheck(u)){o(a,u);return}let c=new Array(u.length);for(let f=0;f<u.length;f++){var p;c[f]=s.asNestedTest({options:r,index:f,parent:u,parentPath:r.path,originalParent:(p=r.originalValue)!=null?p:e})}this.runTests({value:u,tests:c,originalValue:(d=r.originalValue)!=null?d:e,options:r},n,f=>o(f.concat(a),u))})}clone(e){let r=super.clone(e);return r.innerType=this.innerType,r}json(){return this.transform(Cs)}concat(e){let r=super.concat(e);return r.innerType=this.innerType,e.innerType&&(r.innerType=r.innerType?r.innerType.concat(e.innerType):e.innerType),r}of(e){let r=this.clone();if(!Gr(e))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+$e(e));return r.innerType=e,r.spec=Object.assign({},r.spec,{types:e}),r}length(e,r=Lr.length){return this.test({message:r,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(n){return n.length===this.resolve(e)}})}min(e,r){return r=r||Lr.min,this.test({message:r,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(n){return n.length>=this.resolve(e)}})}max(e,r){return r=r||Lr.max,this.test({message:r,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(n){return n.length<=this.resolve(e)}})}ensure(){return this.default(()=>[]).transform((e,r)=>this._typeCheck(e)?e:r==null?[]:[].concat(r))}compact(e){let r=e?(n,o,i)=>!e(n,o,i):n=>!!n;return this.transform(n=>n!=null?n.filter(r):n)}describe(e){let r=(e?this.resolve(e):this).clone(),n=super.describe(e);if(r.innerType){var o;let i=e;(o=i)!=null&&o.value&&(i=Object.assign({},i,{parent:i.value,value:i.value[0]})),n.innerType=r.innerType.describe(i)}return n}};Wf.prototype=Wr.prototype;function Yf(t){return new Yr(t)}var Yr=class extends se{constructor(e){super({type:"tuple",spec:{types:e},check(r){let n=this.spec.types;return Array.isArray(r)&&r.length===n.length}}),this.withMutation(()=>{this.typeError(xs.notType)})}_cast(e,r){let{types:n}=this.spec,o=super._cast(e,r);if(!this._typeCheck(o))return o;let i=!1,s=n.map((l,a)=>{let u=l.cast(o[a],Object.assign({},r,{path:`${r.path||""}[${a}]`}));return u!==o[a]&&(i=!0),u});return i?s:o}_validate(e,r={},n,o){let i=this.spec.types;super._validate(e,r,n,(s,l)=>{var a;if(!this._typeCheck(l)){o(s,l);return}let u=[];for(let[c,p]of i.entries()){var d;u[c]=p.asNestedTest({options:r,index:c,parent:l,parentPath:r.path,originalParent:(d=r.originalValue)!=null?d:e})}this.runTests({value:l,tests:u,originalValue:(a=r.originalValue)!=null?a:e,options:r},n,c=>o(c.concat(s),l))})}describe(e){let r=(e?this.resolve(e):this).clone(),n=super.describe(e);return n.innerType=r.spec.types.map((o,i)=>{var s;let l=e;return(s=l)!=null&&s.value&&(l=Object.assign({},l,{parent:l.value,value:l.value[i]})),o.describe(l)}),n}};Yf.prototype=Yr.prototype;var _isStrongPassword = require('validator/lib/isStrongPassword'); var _isStrongPassword2 = _interopRequireDefault(_isStrongPassword);function Lt(t){let u=t,{name:e,label:r,value:n,onChange:o}=u,i=H(u,["name","label","value","onChange"]),[s,l]=_react.useState.call(void 0, !1);function a(){l(!s)}return _jsxruntime.jsx.call(void 0, _material.TextField,y({name:e,label:r,value:n||"",onChange:o,type:s?"text":"password",InputProps:{endAdornment:_jsxruntime.jsx.call(void 0, _material.InputAdornment,{position:"start",children:_jsxruntime.jsx.call(void 0, _material.InputAdornment,{position:"end",children:_jsxruntime.jsx.call(void 0, _material.IconButton,{onClick:a,edge:"end",children:s?_jsxruntime.jsx.call(void 0, _iconsmaterial.VisibilityOff,{}):_jsxruntime.jsx.call(void 0, _iconsmaterial.Visibility,{})})})})}},i))}function et(t){let{isValid:e,message:r}=t,n=_material.useTheme.call(void 0, );return _jsxruntime.jsxs.call(void 0, _material.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[_jsxruntime.jsx.call(void 0, _iconsmaterial.Circle,{color:e?"success":"inherit",sx:{fontSize:"8pt"}}),_jsxruntime.jsx.call(void 0, _material.Typography,{variant:"body2",sx:{color:e?n.palette.success.main:"inherit",textDecoration:e?"line-through":"none",ml:1,fontSize:"10pt"},children:r})]})}var ks={senhaAtual:"",senhaNova:""},lp=Qe().shape({senhaAtual:Ie().required("Informe a Senha Atual."),senhaNova:Ie().required("Informe a Nova Senha.")});function Hr(t){let{isOpen:e,credentialsConfig:r,onClose:n,onSuccess:o,onFailed:i,primeiroAcesso:s,senhaAtual:l,email:a}=t,{alterarSenha:u,isSubmitting:d}=_hooks.useCredentials.call(void 0, r),{setValidationErrors:c,validationProps:p}=_hooks.useValidations.call(void 0, ),{data:f,handleChange:g,setData:x,changeValue:w}=_hooks.useForm.call(void 0, ks),[A,j]=_react.useState.call(void 0, !1),[ee,P]=_react.useState.call(void 0, null);_react.useEffect.call(void 0, ()=>{l&&w("senhaAtual",l)},[l]),_react.useEffect.call(void 0, ()=>{f.senhaNova&&j(_isStrongPassword2.default.call(void 0, f.senhaNova,{minLength:8,minLowercase:1,minUppercase:1,minNumbers:1,minSymbols:1}))},[f.senhaNova]);function D(){return ue(this,null,function*(){c(null),P(null),lp.validate(f,{abortEarly:!1}).then(()=>ue(this,null,function*(){var m;let{senhaAtual:b,senhaNova:k}=f;try{(yield u(b,k,a))&&(o&&o(),x(ks))}catch(h){if(i&&i(h),_axios.isAxiosError.call(void 0, h)){P((m=h.response)==null?void 0:m.data.message);return}P("Ocorreu um erro ao tentar alterar a senha")}})).catch(b=>{c(b)})})}function te(){return(f==null?void 0:f.senhaNova.length)>=8}function K(){if(f!=null&&f.senhaNova){let b=f==null?void 0:f.senhaNova.match(/[a-z]/g);return Array.isArray(b)&&b.length>0}return!1}function Y(){if(f!=null&&f.senhaNova){let b=f==null?void 0:f.senhaNova.match(/[A-Z]/g);return Array.isArray(b)&&b.length>0}return!1}function W(){if(f!=null&&f.senhaNova){let b=f==null?void 0:f.senhaNova.match(/\d/g);return Array.isArray(b)&&b.length>0}return!1}function v(){if(f!=null&&f.senhaNova){let b=f==null?void 0:f.senhaNova.match(/\W/g);return Array.isArray(b)&&b.length>0}return!1}return _jsxruntime.jsx.call(void 0, we,{title:"Atualizar senha",open:!!e,onClose:()=>n(),actions:_jsxruntime.jsxs.call(void 0, Ne,{children:[_jsxruntime.jsx.call(void 0, ne,{title:"Cancelar altera\xE7\xE3o de senha",color:"error",onClick:n,children:"Cancelar"}),_jsxruntime.jsx.call(void 0, ne,{title:"Confirmar altera\xE7\xE3o de senha",variant:"contained",onClick:D,isLoading:d,disabled:!A,children:"Alterar Senha"})]}),children:_jsxruntime.jsxs.call(void 0, _material.Grid,{container:!0,spacing:2,children:[s&&_jsxruntime.jsx.call(void 0, _material.Grid,{item:!0,xl:12,lg:12,md:12,sm:12,xs:12,children:_jsxruntime.jsxs.call(void 0, _material.Alert,{severity:"info",children:["Voc\xEA est\xE1 acessando o sistema com uma senha tempor\xE1ria.",_jsxruntime.jsx.call(void 0, "br",{}),"Cadastre uma senha segura para deixar sua conta mais protegida."]})}),_jsxruntime.jsx.call(void 0, _material.Grid,{item:!0,xl:12,lg:12,md:12,sm:12,xs:12,children:_jsxruntime.jsx.call(void 0, Lt,y({name:"senhaAtual",label:"Senha Atual",value:(f==null?void 0:f.senhaAtual)||"",onChange:g},p("senhaAtual")))}),_jsxruntime.jsx.call(void 0, _material.Grid,{item:!0,xl:12,lg:12,md:12,sm:12,xs:12,children:_jsxruntime.jsx.call(void 0, Lt,y({name:"senhaNova",label:"Nova Senha",value:(f==null?void 0:f.senhaNova)||"",onChange:g},p("senhaNova")))}),_jsxruntime.jsxs.call(void 0, _material.Grid,{item:!0,xl:12,lg:12,md:12,sm:12,xs:12,children:[_jsxruntime.jsx.call(void 0, et,{isValid:te(),message:"O tamanho m\xEDnimo da nova senha \xE9 de 8 caracteres"}),_jsxruntime.jsx.call(void 0, et,{isValid:K(),message:"A nova senha deve ter ao menos uma letra min\xFAscula"}),_jsxruntime.jsx.call(void 0, et,{isValid:Y(),message:"A nova senha deve ter ao menos uma letra mai\xFAscula"}),_jsxruntime.jsx.call(void 0, et,{isValid:W(),message:"A nova senha deve ter ao menos um n\xFAmero"}),_jsxruntime.jsx.call(void 0, et,{isValid:v(),message:"A nova senha deve ter ao menos um caracter especial"})]}),ee&&_jsxruntime.jsx.call(void 0, _material.Grid,{item:!0,xl:12,lg:12,md:12,sm:12,xs:12,children:_jsxruntime.jsx.call(void 0, _material.Alert,{severity:"error",children:ee})})]})})}var gp=Qe().shape({email:Ie().required("Informe o e-mail"),password:Ie().required("Informe a senha")});function po(t){let{onLoginSuccess:e,onLoginFailed:r,onEsqueciSenhaClick:n,credentialsConfig:o}=t,[i,s]=_react.useState.call(void 0, ""),[l,a]=_react.useState.call(void 0, ""),[u,d]=_react.useState.call(void 0, !1),[c,p]=_react.useState.call(void 0, !1),[f,g]=_react.useState.call(void 0, !1),[x,w]=_react.useState.call(void 0, !1),[A,j]=_react.useState.call(void 0, null),{login:ee}=_hooks.useCredentials.call(void 0, o),{validationProps:P,setValidationErrors:D}=_hooks.useValidations.call(void 0, );function te(){d(!u)}function K(){return ue(this,null,function*(){D(null),j(null),gp.validate({email:i,password:l},{abortEarly:!1}).then(()=>ue(this,null,function*(){var Y,W;p(!0);try{let v=yield ee(i,l);v&&e(v)}catch(v){if(_axios.isAxiosError.call(void 0, v)){if(((Y=v.response)==null?void 0:Y.data.code)==="E_FIRST_ACCESS"){g(!0);return}j((W=v.response)==null?void 0:W.data.message)}r(v)}})).catch(Y=>{D(Y)}).finally(()=>{p(!1)})})}return _jsxruntime.jsxs.call(void 0, _material.Box,{component:"form",children:[x&&_jsxruntime.jsxs.call(void 0, _material.Alert,{severity:"success",children:["Senha cadastrada com sucesso",_jsxruntime.jsx.call(void 0, "br",{}),"Tudo pronto para voc\xEA fazer o login"]}),_jsxruntime.jsx.call(void 0, _material.TextField,y({name:"email",label:"E-mail",margin:"normal",autoFocus:!0,value:i||"",onChange:Y=>s(Y.target.value)},P("email"))),_jsxruntime.jsx.call(void 0, _material.TextField,y({name:"password",label:"Senha",margin:"normal",value:l||"",onChange:Y=>a(Y.target.value),type:u?"text":"password",onKeyDown:Y=>Y.key==="Enter"&&K(),InputProps:{endAdornment:_jsxruntime.jsx.call(void 0, _material.InputAdornment,{position:"start",children:_jsxruntime.jsx.call(void 0, _material.InputAdornment,{position:"end",children:_jsxruntime.jsx.call(void 0, _material.IconButton,{onClick:te,edge:"end",children:u?_jsxruntime.jsx.call(void 0, _iconsmaterial.VisibilityOff,{}):_jsxruntime.jsx.call(void 0, _iconsmaterial.Visibility,{})})})})}},P("password"))),_jsxruntime.jsx.call(void 0, ne,{fullWidth:!0,variant:"contained",onClick:K,isLoading:c,sx:{mt:1},children:"Entrar"}),_jsxruntime.jsx.call(void 0, ne,{onClick:n,variant:"text",sx:{marginTop:.5,fontWeight:"400",":hover":{color:Y=>Y.palette.primary.dark}},children:"Esqueci a senha"}),A&&_jsxruntime.jsx.call(void 0, _material.Alert,{severity:"error",children:A}),_jsxruntime.jsx.call(void 0, Hr,{senhaAtual:l,email:i,primeiroAcesso:!0,isOpen:f,onClose:()=>g(!1),onSuccess:()=>{g(!1),w(!0),a("")},credentialsConfig:o})]})}var Tp=Qe().shape({email:Ie().required("Informe o e-mail")});function mo(t){let{onLoginClick:e,credentialsConfig:r}=t,[n,o]=_react.useState.call(void 0, ""),[i,s]=_react.useState.call(void 0, !1),[l,a]=_react.useState.call(void 0, !1),[u,d]=_react.useState.call(void 0, null),{recuperarSenha:c}=_hooks.useCredentials.call(void 0, r),{validationProps:p,setValidationErrors:f}=_hooks.useValidations.call(void 0, );function g(){return ue(this,null,function*(){f(null),Tp.validate({email:n},{abortEarly:!1}).then(()=>ue(this,null,function*(){var x;try{s(!0),yield c(n),a(!0)}catch(w){d((x=w.response)==null?void 0:x.data.message)}finally{s(!1)}})).catch(x=>{f(x)})})}return _jsxruntime.jsxs.call(void 0, _material.Box,{component:"form",children:[_jsxruntime.jsx.call(void 0, _material.TextField,y({name:"email",label:"E-mail",margin:"normal",placeholder:"Informe o e-mail utilizado para acessar o sistema",autoFocus:!0,value:n||"",onChange:x=>o(x.target.value)},p("email"))),_jsxruntime.jsxs.call(void 0, Ne,{sx:{display:"inline-flex",justifyContent:"space-between",width:"100%",marginTop:1},children:[_jsxruntime.jsx.call(void 0, ne,{onClick:e,variant:"text",sx:{fontWeight:"400",":hover":{color:x=>x.palette.primary.dark}},children:"Voltar"}),_jsxruntime.jsx.call(void 0, ne,{variant:"contained",onClick:g,isLoading:i,children:"Recuperar Senha"})]}),l&&_jsxruntime.jsx.call(void 0, _material.Alert,{severity:"success",action:_jsxruntime.jsx.call(void 0, ne,{onClick:e,variant:"text",sx:{fontWeight:"400",":hover":{color:x=>x.palette.primary.dark}},children:"Ir para o Login"}),children:"Enviamos para o seu e-mail as instru\xE7\xF5es para recuperar a sua senha"}),u&&_jsxruntime.jsx.call(void 0, _material.Alert,{severity:"error",children:u})]})}function go(t){var d;let{loginData:e,credentialsConfig:r,onLoginFailed:n,onLoginSuccess:o}=t,[i,s]=_react.useState.call(void 0, ""),{selecionarLicenca:l,isSubmitting:a}=_hooks.useCredentials.call(void 0, r);_react.useEffect.call(void 0, ()=>{if(Array.isArray(e==null?void 0:e.empresas)){let c=e==null?void 0:e.empresas[0];s(c==null?void 0:c.uuid)}},[e]);function u(){return ue(this,null,function*(){try{let c=yield l(e,i);c?o(c):n("Nenhuma token definida")}catch(c){n(c)}})}return _jsxruntime.jsxs.call(void 0, _material.Box,{component:"form",sx:{minWidth:"290px"},children:[_jsxruntime.jsx.call(void 0, _material.TextField,{label:"Licen\xE7as",margin:"normal",select:!0,autoFocus:!0,value:i,onChange:c=>{s(c.target.value)},children:(d=e==null?void 0:e.empresas)==null?void 0:d.map(c=>_jsxruntime.jsx.call(void 0, _material.MenuItem,{value:c.uuid,children:c.nome},c.uuid))}),_jsxruntime.jsx.call(void 0, ne,{fullWidth:!0,variant:"contained",onClick:u,isLoading:a,sx:{mt:1},children:"Confirmar"})]})}function Is(t){var x;let{credentialsConfig:e,onLoginSuccess:r,onLoginFailed:n,onAlreadyLogged:o,appName:i}=t,[s,l]=_react.useState.call(void 0, ),{selecionarLicenca:a,isAuthenticated:u}=_hooks.useCredentials.call(void 0, e),[d,c]=_react.useState.call(void 0, !1);_react.useEffect.call(void 0, ()=>{u&&o&&o()},[u]);function p(w){return ue(this,null,function*(){try{if(Array.isArray(w==null?void 0:w.empresas)){if((w==null?void 0:w.empresas.length)===1){let A=yield a(w,w.empresas[0].uuid);A&&r(A);return}l(w);return}r(w)}catch(A){n(A)}})}function f(w){return ue(this,null,function*(){n(w)})}function g(){c(!d)}return _jsxruntime.jsx.call(void 0, _material.Box,{sx:{height:"100vh"},children:_jsxruntime.jsxs.call(void 0, _material.Container,{component:"main",maxWidth:"xs",sx:{height:"80%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2},children:[_jsxruntime.jsx.call(void 0, "img",{src:"https://datac-site-assets.s3.sa-east-1.amazonaws.com/logo.png"}),_jsxruntime.jsx.call(void 0, _material.Paper,{children:_jsxruntime.jsxs.call(void 0, _material.Stack,{sx:{padding:5},children:[_jsxruntime.jsx.call(void 0, to,{label:i}),!d&&_jsxruntime.jsx.call(void 0, _material.Box,{sx:{marginTop:3},children:s!=null&&s.empresas&&((x=s==null?void 0:s.empresas)==null?void 0:x.length)>0?_jsxruntime.jsx.call(void 0, go,{loginData:s,credentialsConfig:e,onLoginSuccess:r,onLoginFailed:n}):_jsxruntime.jsx.call(void 0, po,{credentialsConfig:e,onLoginSuccess:p,onLoginFailed:f,onEsqueciSenhaClick:g})}),d&&_jsxruntime.jsx.call(void 0, _material.Box,{sx:{marginTop:3},children:_jsxruntime.jsx.call(void 0, mo,{onLoginClick:g,credentialsConfig:e})})]})})]})})}var Lp=t=>({transition:t.transitions.create(["transform"],{duration:500})}),jp=_styles.styled.call(void 0, _iconsmaterial.KeyboardArrowRight,{shouldForwardProp:t=>t!=="open"})(({theme:t,open:e})=>y(y(y({color:t.palette.primary.dark},Lp(t)),e&&{transform:"rotate(-180deg)"}),!e&&{transform:"rotate(0)"}));function bo(t){let{open:e,onToogleDrawerMenu:r}=t;return _jsxruntime.jsx.call(void 0, _material.Stack,{width:"90%",direction:"row",justifyContent:e?"flex-end":"center",margin:"16px auto",children:_jsxruntime.jsx.call(void 0, _material.IconButton,{size:"small","aria-label":"open drawer",onClick:r,children:_jsxruntime.jsx.call(void 0, jp,{fontSize:"small",open:e})})})}var Vp=_styles.styled.call(void 0, _material.MenuItem,{})(({theme:t})=>({borderRadius:"6px",width:"90%",gap:"16px",margin:"0 auto",padding:"8px 16px",transition:"0.1s ease-in-out","&:hover":{backgroundColor:"rgba(89, 195, 224, 15%);","& .MuiTypography-root":{color:t.palette.primary.main},"& .MuiSvgIcon-root":{color:t.palette.primary.main},"& .MuiIcon-root":{color:t.palette.primary.main}},"& .MuiIcon-root":{color:t.palette.grey[500],fontSize:"20px"},"& .MuiTypography-root":{letterSpacing:"0.5px",color:t.palette.text.secondary,fontSize:t.typography.body1},"& .MuiSvgIcon-root":{fontSize:"24px"}})),Up=t=>_jsxruntime.jsx.call(void 0, Vp,y({},t)),Xr=Up;function vo(t){let{menuItem:e,activeMenu:r,onMenuClick:n}=t,[o,i]=_react.useState.call(void 0, !1);if(!e.visible)return null;let s=!!(e!=null&&e.items&&(e==null?void 0:e.items.length)>0);function l(){i(!o)}return _jsxruntime.jsxs.call(void 0, _material.Box,{children:[_jsxruntime.jsxs.call(void 0, Xr,{onClick:()=>{if(e!=null&&e.link){n(e.link);return}l()},selected:r===e.link,children:[!!e.icon&&_jsxruntime.jsx.call(void 0, _material.Icon,{children:e.icon}),_jsxruntime.jsx.call(void 0, _material.ListItemText,{primary:e.label}),s&&!o&&_jsxruntime.jsx.call(void 0, _iconsmaterial.ExpandMore,{}),s&&o&&_jsxruntime.jsx.call(void 0, _iconsmaterial.ExpandLess,{})]}),(e==null?void 0:e.items)&&_jsxruntime.jsx.call(void 0, _material.Collapse,{in:o,timeout:"auto",unmountOnExit:!0,children:_jsxruntime.jsx.call(void 0, rt,{activeMenu:r,sx:{pl:a=>a.spacing(1.5)},menus:(e==null?void 0:e.items)||[],onMenuClick:n})})]})}function rt(t){let i=t,{menus:e,activeMenu:r,onMenuClick:n}=i,o=H(i,["menus","activeMenu","onMenuClick"]);return _jsxruntime.jsx.call(void 0, _material.List,N(y({component:"nav",disablePadding:!0},o),{children:e.map(s=>_jsxruntime.jsx.call(void 0, vo,{onMenuClick:n,activeMenu:r,menuItem:s},s.id))}))}function To(t){let{menus:e,activeMenu:r,onMenuClick:n}=t,[o,i]=_react.useState.call(void 0, null),s=(a,u,d)=>{i({element:a.currentTarget,id:u,items:d})},l=()=>{i(null)};return _jsxruntime.jsx.call(void 0, _material.List,{component:"nav",disablePadding:!0,children:e.map(a=>a.visible?_jsxruntime.jsxs.call(void 0, Xr,{onMouseEnter:u=>{a!=null&&a.link||s(u,a.id,a.items)},onMouseLeave:()=>{a!=null&&a.link||l()},onClick:()=>{a!=null&&a.link&&n(a.link)},selected:r===a.link,children:[_jsxruntime.jsx.call(void 0, _material.ListItemIcon,{children:_jsxruntime.jsx.call(void 0, _material.Icon,{children:a.icon})}),(o==null?void 0:o.id)===a.id&&_jsxruntime.jsx.call(void 0, _material.Popper,{sx:{zIndex:999999},anchorEl:o==null?void 0:o.element,open:!!(o!=null&&o.element),placement:"right-start",children:_jsxruntime.jsx.call(void 0, rt,{activeMenu:r,onMenuClick:n,menus:(a==null?void 0:a.items)||[],sx:{minWidth:"240px",backgroundColor:L.palette.background.paper,borderRadius:"12px",padding:"16px 4px",boxShadow:"0px 5px 5px -3px rgb(0 0 0 / 20%), 0px 8px 10px 1px rgb(0 0 0 / 14%), 0px 3px 14px 2px rgb(0 0 0 / 12%);"}})})]},`minMenu-${a.id}`):null)})}var Ns=(t,e)=>({width:t,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:"hidden"}),zs=t=>({transition:t.transitions.create("width",{easing:t.transitions.easing.sharp,duration:t.transitions.duration.leavingScreen}),overflowX:"hidden",width:`calc(${t.spacing(8)} + 1px)`,[t.breakpoints.up("sm")]:{width:`calc(${t.spacing(8)} + 1px)`}}),fd=_styles.styled.call(void 0, _material.Drawer,{shouldForwardProp:t=>t!=="open"&&t!=="width"})(({theme:t,open:e,width:r})=>y(y({width:r,bgcolor:t.palette.background.paper,boxShadow:"2px 3px 20px -16px rgb(32 32 36 / 30%)",borderRightStyle:"none",whiteSpace:"nowrap",boxSizing:"border-box"},e&&N(y({},Ns(r,t)),{"& .MuiDrawer-paper":Ns(r,t)})),!e&&N(y({},zs(t)),{"& .MuiDrawer-paper":zs(t)})));function Vs(t){let g=t,{open:e,items:r,width:n,logo:o,minLogo:i,label:s,minLabel:l,link:a,version:u,activeMenu:d,onMenuClick:c,toggleMenu:p}=g,f=H(g,["open","items","width","logo","minLogo","label","minLabel","link","version","activeMenu","onMenuClick","toggleMenu"]);return _jsxruntime.jsxs.call(void 0, fd,N(y({width:n,open:e,onClose:()=>p(!1)},f),{children:[_jsxruntime.jsx.call(void 0, _material.Box,{sx:{height:L.mixins.toolbar},children:_jsxruntime.jsxs.call(void 0, _material.Stack,{spacing:.5,alignItems:"center",p:1,children:[_jsxruntime.jsx.call(void 0, "img",{src:e?o:i,alt:"logo"}),_jsxruntime.jsxs.call(void 0, _material.Typography,{variant:"body2",fontWeight:e?"700":"400",children:[e?s:l," ",u&&_jsxruntime.jsx.call(void 0, _material.Link,{underline:"none",target:"_blank",rel:"noreferrer",href:a,children:u})]})]})}),_jsxruntime.jsx.call(void 0, bo,{open:!!e,onToogleDrawerMenu:p}),e&&_jsxruntime.jsx.call(void 0, rt,{onMenuClick:c,activeMenu:d,menus:r}),!e&&_jsxruntime.jsx.call(void 0, To,{onMenuClick:c,activeMenu:d,menus:r})]}))}function Ys(t){let{typographyProps:e,onChange:r,value:n,displayEditButton:o,displaySaveButton:i,textFieldProps:s}=t,w=s||{},{InputProps:l,value:a,onKeyDown:u,onChange:d}=w,c=H(w,["InputProps","value","onKeyDown","onChange"]),[p,f]=_react.useState.call(void 0, !1),[g,x]=_react.useState.call(void 0, );return _react.useEffect.call(void 0, ()=>{x(n)},[n]),_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[!p&&_jsxruntime.jsxs.call(void 0, _material.Stack,{direction:"row",alignItems:"center",spacing:1,children:[_jsxruntime.jsx.call(void 0, _material.Typography,N(y({onDoubleClick:()=>{f(!0)}},e),{children:n})),o&&_jsxruntime.jsx.call(void 0, _material.IconButton,{onClick:()=>{f(!0)},children:_jsxruntime.jsx.call(void 0, _iconsmaterial.Edit,{})})]}),p&&_jsxruntime.jsx.call(void 0, _material.ClickAwayListener,{onClickAway:()=>f(!1),children:_jsxruntime.jsx.call(void 0, _material.TextField,y({autoFocus:!0,value:g,onKeyDown:A=>{A.key==="Enter"&&(r(g),f(!1)),A.key==="Escape"&&(x(n),f(!1))},onChange:A=>{let j=A.target.value;x(j)},InputProps:{endAdornment:i&&_jsxruntime.jsx.call(void 0, _material.InputAdornment,{position:"end",children:_jsxruntime.jsx.call(void 0, _material.IconButton,{onClick:()=>{n!=g&&r(g),f(!1)},edge:"end",children:n!=g?_jsxruntime.jsx.call(void 0, _iconsmaterial.Save,{}):_jsxruntime.jsx.call(void 0, _iconsmaterial.Cancel,{})})})}},c))})]})}exports.AlterarSenha = Hr; exports.Button = ne; exports.ButtonContainer = Ne; exports.Checkbox = _o; exports.ColorsGrid = Fo; exports.CurrencyCellStyle = Ym; exports.CurrencyTextField = un; exports.DataTable = el; exports.DataTableOptions = mn; exports.DeleteContainer = pn; exports.Dialog = we; exports.DrawerMenu = Vs; exports.Editable = Ys; exports.FilterContainer = vn; exports.FilterControl = Yt; exports.Flag = Ko; exports.FormContainer = Sn; exports.LabelValue = Yi; exports.MioAuth = Is; exports.OptionStyles = Wm; exports.PageTitle = Zi; exports.PasswordTextField = Lt; exports.SearchTextField = Rr; exports.Tooltip = it; exports.Transporter = eo; exports.theme = L;
9
+ `+(l!==s?`result of cast: ${l}`:""))}return i}_cast(e,r){let n=e===void 0?e:this.transforms.reduce((o,i)=>i.call(this,o,e,this),e);return n===void 0&&(n=this.getDefault(r)),n}_validate(e,r={},n,o){let{path:i,originalValue:s=e,strict:l=this.spec.strict}=r,a=e;l||(a=this._cast(a,Object.assign({assert:!1},r)));let u=[];for(let d of Object.values(this.internalTests))d&&u.push(d);this.runTests({path:i,value:a,originalValue:s,options:r,tests:u},n,d=>{if(d.length)return o(d,a);this.runTests({path:i,value:a,originalValue:s,options:r,tests:this.tests},n,o)})}runTests(e,r,n){let o=!1,{tests:i,value:s,originalValue:l,path:a,options:u}=e,d=x=>{o||(o=!0,r(x,s))},c=x=>{o||(o=!0,n(x,s))},p=i.length,f=[];if(!p)return c([]);let g={value:s,originalValue:l,path:a,options:u,schema:this};for(let x=0;x<i.length;x++){let w=i[x];w(g,d,function(j){j&&(Array.isArray(j)?f.push(...j):f.push(j)),--p<=0&&c(f)})}}asNestedTest({key:e,index:r,parent:n,parentPath:o,originalParent:i,options:s}){let l=e!=null?e:r;if(l==null)throw TypeError("Must include `key` or `index` for nested validations");let a=typeof l=="number",u=n[l],d=Object.assign({},s,{strict:!0,parent:n,value:u,originalValue:i[l],key:void 0,[a?"index":"key"]:l,path:a||l.includes(".")?`${o||""}[${u?l:`"${l}"`}]`:(o?`${o}.`:"")+e});return(c,p,f)=>this.resolve(d)._validate(u,d,p,f)}validate(e,r){var n;let o=this.resolve(Object.assign({},r,{value:e})),i=(n=r==null?void 0:r.disableStackTrace)!=null?n:o.spec.disableStackTrace;return new Promise((s,l)=>o._validate(e,r,(a,u)=>{ce.isError(a)&&(a.value=u),l(a)},(a,u)=>{a.length?l(new ce(a,u,void 0,void 0,i)):s(u)}))}validateSync(e,r){var n;let o=this.resolve(Object.assign({},r,{value:e})),i,s=(n=r==null?void 0:r.disableStackTrace)!=null?n:o.spec.disableStackTrace;return o._validate(e,Object.assign({},r,{sync:!0}),(l,a)=>{throw ce.isError(l)&&(l.value=a),l},(l,a)=>{if(l.length)throw new ce(l,e,void 0,void 0,s);i=a}),i}isValid(e,r){return this.validate(e,r).then(()=>!0,n=>{if(ce.isError(n))return!1;throw n})}isValidSync(e,r){try{return this.validateSync(e,r),!0}catch(n){if(ce.isError(n))return!1;throw n}}_getDefault(e){let r=this.spec.default;return r==null?r:typeof r=="function"?r.call(this,e):ht(r)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,r){let n=this.clone({nullable:e});return n.internalTests.nullable=mt({message:r,name:"nullable",test(o){return o===null?this.schema.spec.nullable:!0}}),n}optionality(e,r){let n=this.clone({optional:e});return n.internalTests.optionality=mt({message:r,name:"optionality",test(o){return o===void 0?this.schema.spec.optional:!0}}),n}optional(){return this.optionality(!0)}defined(e=Ae.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=Ae.notNull){return this.nullability(!1,e)}required(e=Ae.required){return this.clone().withMutation(r=>r.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let r=this.clone();return r.transforms.push(e),r}test(...e){let r;if(e.length===1?typeof e[0]=="function"?r={test:e[0]}:r=e[0]:e.length===2?r={name:e[0],test:e[1]}:r={name:e[0],message:e[1],test:e[2]},r.message===void 0&&(r.message=Ae.default),typeof r.test!="function")throw new TypeError("`test` is a required parameters");let n=this.clone(),o=mt(r),i=r.exclusive||r.name&&n.exclusiveTests[r.name]===!0;if(r.exclusive&&!r.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return r.name&&(n.exclusiveTests[r.name]=!!r.exclusive),n.tests=n.tests.filter(s=>!(s.OPTIONS.name===r.name&&(i||s.OPTIONS.test===o.OPTIONS.test))),n.tests.push(o),n}when(e,r){!Array.isArray(e)&&typeof e!="string"&&(r=e,e=".");let n=this.clone(),o=gs(e).map(i=>new Be(i));return o.forEach(i=>{i.isSibling&&n.deps.push(i.key)}),n.conditions.push(typeof r=="function"?new gt(o,r):gt.fromOptions(o,r)),n}typeError(e){let r=this.clone();return r.internalTests.typeError=mt({message:e,name:"typeError",skipAbsent:!0,test(n){return this.schema._typeCheck(n)?!0:this.createError({params:{type:this.schema.type}})}}),r}oneOf(e,r=Ae.oneOf){let n=this.clone();return e.forEach(o=>{n._whitelist.add(o),n._blacklist.delete(o)}),n.internalTests.whiteList=mt({message:r,name:"oneOf",skipAbsent:!0,test(o){let i=this.schema._whitelist,s=i.resolveAll(this.resolve);return s.includes(o)?!0:this.createError({params:{values:Array.from(i).join(", "),resolved:s}})}}),n}notOneOf(e,r=Ae.notOneOf){let n=this.clone();return e.forEach(o=>{n._blacklist.add(o),n._whitelist.delete(o)}),n.internalTests.blacklist=mt({message:r,name:"notOneOf",test(o){let i=this.schema._blacklist,s=i.resolveAll(this.resolve);return s.includes(o)?this.createError({params:{values:Array.from(i).join(", "),resolved:s}}):!0}}),n}strip(e=!0){let r=this.clone();return r.spec.strip=e,r}describe(e){let r=(e?this.resolve(e):this).clone(),{label:n,meta:o,optional:i,nullable:s}=r.spec;return{meta:o,label:n,optional:i,nullable:s,default:r.getDefault(e),type:r.type,oneOf:r._whitelist.describe(),notOneOf:r._blacklist.describe(),tests:r.tests.map(a=>({name:a.OPTIONS.name,params:a.OPTIONS.params})).filter((a,u,d)=>d.findIndex(c=>c.name===a.name)===u)}}};se.prototype.__isYupSchema__=!0;for(let t of["validate","validateSync"])se.prototype[`${t}At`]=function(e,r,n={}){let{parent:o,parentPath:i,schema:s}=_f(this,e,r,n.context);return s[t](o&&o[i],Object.assign({},n,{parent:o,path:e}))};for(let t of["equals","is"])se.prototype[t]=se.prototype.oneOf;for(let t of["not","nope"])se.prototype[t]=se.prototype.notOneOf;var kf=()=>!0;function Ff(t){return new Nr(t)}var Nr=class extends se{constructor(e){super(typeof e=="function"?{type:"mixed",check:e}:Object.assign({type:"mixed",check:kf},e))}};Ff.prototype=Nr.prototype;function Of(){return new zr}var zr=class extends se{constructor(){super({type:"boolean",check(e){return e instanceof Boolean&&(e=e.valueOf()),typeof e=="boolean"}}),this.withMutation(()=>{this.transform((e,r,n)=>{if(n.spec.coerce&&!n.isType(e)){if(/^(true|1)$/i.test(String(e)))return!0;if(/^(false|0)$/i.test(String(e)))return!1}return e})})}isTrue(e=uo.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"true"},test(r){return ke(r)||r===!0}})}isFalse(e=uo.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"false"},test(r){return ke(r)||r===!1}})}default(e){return super.default(e)}defined(e){return super.defined(e)}optional(){return super.optional()}required(e){return super.required(e)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(e){return super.nonNullable(e)}strip(e){return super.strip(e)}};Of.prototype=zr.prototype;var Af=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Mf=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,Df=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Rf=t=>ke(t)||t===t.trim(),$f={}.toString();function Ie(){return new Vr}var Vr=class extends se{constructor(){super({type:"string",check(e){return e instanceof String&&(e=e.valueOf()),typeof e=="string"}}),this.withMutation(()=>{this.transform((e,r,n)=>{if(!n.spec.coerce||n.isType(e)||Array.isArray(e))return e;let o=e!=null&&e.toString?e.toString():e;return o===$f?e:o})})}required(e){return super.required(e).withMutation(r=>r.test({message:e||Ae.required,name:"required",skipAbsent:!0,test:n=>!!n.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(r=>r.OPTIONS.name!=="required"),e))}length(e,r=_e.length){return this.test({message:r,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(n){return n.length===this.resolve(e)}})}min(e,r=_e.min){return this.test({message:r,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(n){return n.length>=this.resolve(e)}})}max(e,r=_e.max){return this.test({name:"max",exclusive:!0,message:r,params:{max:e},skipAbsent:!0,test(n){return n.length<=this.resolve(e)}})}matches(e,r){let n=!1,o,i;return r&&(typeof r=="object"?{excludeEmptyString:n=!1,message:o,name:i}=r:o=r),this.test({name:i||"matches",message:o||_e.matches,params:{regex:e},skipAbsent:!0,test:s=>s===""&&n||s.search(e)!==-1})}email(e=_e.email){return this.matches(Af,{name:"email",message:e,excludeEmptyString:!0})}url(e=_e.url){return this.matches(Mf,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=_e.uuid){return this.matches(Df,{name:"uuid",message:e,excludeEmptyString:!1})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=_e.trim){return this.transform(r=>r!=null?r.trim():r).test({message:e,name:"trim",test:Rf})}lowercase(e=_e.lowercase){return this.transform(r=>ke(r)?r:r.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>ke(r)||r===r.toLowerCase()})}uppercase(e=_e.uppercase){return this.transform(r=>ke(r)?r:r.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>ke(r)||r===r.toUpperCase()})}};Ie.prototype=Vr.prototype;var Bf=t=>t!=+t;function If(){return new Ur}var Ur=class extends se{constructor(){super({type:"number",check(e){return e instanceof Number&&(e=e.valueOf()),typeof e=="number"&&!Bf(e)}}),this.withMutation(()=>{this.transform((e,r,n)=>{if(!n.spec.coerce)return e;let o=e;if(typeof o=="string"){if(o=o.replace(/\s/g,""),o==="")return NaN;o=+o}return n.isType(o)||o===null?o:parseFloat(o)})})}min(e,r=We.min){return this.test({message:r,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(n){return n>=this.resolve(e)}})}max(e,r=We.max){return this.test({message:r,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(n){return n<=this.resolve(e)}})}lessThan(e,r=We.lessThan){return this.test({message:r,name:"max",exclusive:!0,params:{less:e},skipAbsent:!0,test(n){return n<this.resolve(e)}})}moreThan(e,r=We.moreThan){return this.test({message:r,name:"min",exclusive:!0,params:{more:e},skipAbsent:!0,test(n){return n>this.resolve(e)}})}positive(e=We.positive){return this.moreThan(0,e)}negative(e=We.negative){return this.lessThan(0,e)}integer(e=We.integer){return this.test({name:"integer",message:e,skipAbsent:!0,test:r=>Number.isInteger(r)})}truncate(){return this.transform(e=>ke(e)?e:e|0)}round(e){var r;let n=["ceil","floor","round","trunc"];if(e=((r=e)==null?void 0:r.toLowerCase())||"round",e==="trunc")return this.truncate();if(n.indexOf(e.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+n.join(", "));return this.transform(o=>ke(o)?o:Math[e](o))}};If.prototype=Ur.prototype;var Lf=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function Re(t,e=0){return Number(t)||e}function jf(t){let e=Lf.exec(t);if(!e)return Date.parse?Date.parse(t):Number.NaN;let r={year:Re(e[1]),month:Re(e[2],1)-1,day:Re(e[3],1),hour:Re(e[4]),minute:Re(e[5]),second:Re(e[6]),millisecond:e[7]?Re(e[7].substring(0,3)):0,z:e[8]||void 0,plusMinus:e[9]||void 0,hourOffset:Re(e[10]),minuteOffset:Re(e[11])};if(r.z===void 0&&r.plusMinus===void 0)return new Date(r.year,r.month,r.day,r.hour,r.minute,r.second,r.millisecond).valueOf();let n=0;return r.z!=="Z"&&r.plusMinus!==void 0&&(n=r.hourOffset*60+r.minuteOffset,r.plusMinus==="+"&&(n=0-n)),Date.UTC(r.year,r.month,r.day,r.hour,r.minute+n,r.second,r.millisecond)}var bs=new Date(""),Nf=t=>Object.prototype.toString.call(t)==="[object Date]";function vs(){return new Je}var Je=class extends se{constructor(){super({type:"date",check(e){return Nf(e)&&!isNaN(e.getTime())}}),this.withMutation(()=>{this.transform((e,r,n)=>!n.spec.coerce||n.isType(e)||e===null?e:(e=jf(e),isNaN(e)?Je.INVALID_DATE:new Date(e)))})}prepareParam(e,r){let n;if(Be.isRef(e))n=e;else{let o=this.cast(e);if(!this._typeCheck(o))throw new TypeError(`\`${r}\` must be a Date or a value that can be \`cast()\` to a Date`);n=o}return n}min(e,r=lo.min){let n=this.prepareParam(e,"min");return this.test({message:r,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(o){return o>=this.resolve(n)}})}max(e,r=lo.max){let n=this.prepareParam(e,"max");return this.test({message:r,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(o){return o<=this.resolve(n)}})}};Je.INVALID_DATE=bs;vs.prototype=Je.prototype;vs.INVALID_DATE=bs;function zf(t,e=[]){let r=[],n=new Set,o=new Set(e.map(([s,l])=>`${s}-${l}`));function i(s,l){let a=(0,Pe.split)(s)[0];n.add(a),o.has(`${l}-${a}`)||r.push([l,a])}for(let s of Object.keys(t)){let l=t[s];n.add(s),Be.isRef(l)&&l.isSibling?i(l.path,s):Gr(l)&&"deps"in l&&l.deps.forEach(a=>i(a,s))}return hs.default.array(Array.from(n),r).reverse()}function ds(t,e){let r=1/0;return t.some((n,o)=>{var i;if((i=e.path)!=null&&i.includes(n))return r=o,!0}),r}function Ts(t){return(e,r)=>ds(t,e)-ds(t,r)}var Cs=(t,e,r)=>{if(typeof t!="string")return t;let n=t;try{n=JSON.parse(t)}catch(o){}return r.isType(n)?n:t};function jr(t){if("fields"in t){let e={};for(let[r,n]of Object.entries(t.fields))e[r]=jr(n);return t.setFields(e)}if(t.type==="array"){let e=t.optional();return e.innerType&&(e.innerType=jr(e.innerType)),e}return t.type==="tuple"?t.optional().clone({types:t.spec.types.map(jr)}):"optional"in t?t.optional():t}var Vf=(t,e)=>{let r=[...(0,Pe.normalizePath)(e)];if(r.length===1)return r[0]in t;let n=r.pop(),o=(0,Pe.getter)((0,Pe.join)(r),!0)(t);return!!(o&&n in o)},ms=t=>Object.prototype.toString.call(t)==="[object Object]";function Uf(t,e){let r=Object.keys(t.fields);return Object.keys(e).filter(n=>r.indexOf(n)===-1)}var qf=Ts([]);function Qe(t){return new qr(t)}var qr=class extends se{constructor(e){super({type:"object",check(r){return ms(r)||typeof r=="function"}}),this.fields=Object.create(null),this._sortErrors=qf,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,r={}){var n;let o=super._cast(e,r);if(o===void 0)return this.getDefault(r);if(!this._typeCheck(o))return o;let i=this.fields,s=(n=r.stripUnknown)!=null?n:this.spec.noUnknown,l=[].concat(this._nodes,Object.keys(o).filter(c=>!this._nodes.includes(c))),a={},u=Object.assign({},r,{parent:a,__validating:r.__validating||!1}),d=!1;for(let c of l){let p=i[c],f=c in o;if(p){let g,x=o[c];u.path=(r.path?`${r.path}.`:"")+c,p=p.resolve({value:x,context:r.context,parent:a});let w=p instanceof se?p.spec:void 0,A=w==null?void 0:w.strict;if(w!=null&&w.strip){d=d||c in o;continue}g=!r.__validating||!A?p.cast(o[c],u):o[c],g!==void 0&&(a[c]=g)}else f&&!s&&(a[c]=o[c]);(f!==c in a||a[c]!==o[c])&&(d=!0)}return d?a:o}_validate(e,r={},n,o){let{from:i=[],originalValue:s=e,recursive:l=this.spec.recursive}=r;r.from=[{schema:this,value:s},...i],r.__validating=!0,r.originalValue=s,super._validate(e,r,n,(a,u)=>{if(!l||!ms(u)){o(a,u);return}s=s||u;let d=[];for(let c of this._nodes){let p=this.fields[c];!p||Be.isRef(p)||d.push(p.asNestedTest({options:r,key:c,parent:u,parentPath:r.path,originalParent:s}))}this.runTests({tests:d,value:u,originalValue:s,options:r},n,c=>{o(c.sort(this._sortErrors).concat(a),u)})})}clone(e){let r=super.clone(e);return r.fields=Object.assign({},this.fields),r._nodes=this._nodes,r._excludedEdges=this._excludedEdges,r._sortErrors=this._sortErrors,r}concat(e){let r=super.concat(e),n=r.fields;for(let[o,i]of Object.entries(this.fields)){let s=n[o];n[o]=s===void 0?i:s}return r.withMutation(o=>o.setFields(n,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let r={};return this._nodes.forEach(n=>{var o;let i=this.fields[n],s=e;(o=s)!=null&&o.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[n]})),r[n]=i&&"getDefault"in i?i.getDefault(s):void 0}),r}setFields(e,r){let n=this.clone();return n.fields=e,n._nodes=zf(e,r),n._sortErrors=Ts(Object.keys(e)),r&&(n._excludedEdges=r),n}shape(e,r=[]){return this.clone().withMutation(n=>{let o=n._excludedEdges;return r.length&&(Array.isArray(r[0])||(r=[r]),o=[...n._excludedEdges,...r]),n.setFields(Object.assign(n.fields,e),o)})}partial(){let e={};for(let[r,n]of Object.entries(this.fields))e[r]="optional"in n&&n.optional instanceof Function?n.optional():n;return this.setFields(e)}deepPartial(){return jr(this)}pick(e){let r={};for(let n of e)this.fields[n]&&(r[n]=this.fields[n]);return this.setFields(r,this._excludedEdges.filter(([n,o])=>e.includes(n)&&e.includes(o)))}omit(e){let r=[];for(let n of Object.keys(this.fields))e.includes(n)||r.push(n);return this.pick(r)}from(e,r,n){let o=(0,Pe.getter)(e,!0);return this.transform(i=>{if(!i)return i;let s=i;return Vf(i,e)&&(s=Object.assign({},i),n||delete s[e],s[r]=o(i)),s})}json(){return this.transform(Cs)}noUnknown(e=!0,r=co.noUnknown){typeof e!="boolean"&&(r=e,e=!0);let n=this.test({name:"noUnknown",exclusive:!0,message:r,test(o){if(o==null)return!0;let i=Uf(this.schema,o);return!e||i.length===0||this.createError({params:{unknown:i.join(", ")}})}});return n.spec.noUnknown=e,n}unknown(e=!0,r=co.noUnknown){return this.noUnknown(!e,r)}transformKeys(e){return this.transform(r=>{if(!r)return r;let n={};for(let o of Object.keys(r))n[e(o)]=r[o];return n})}camelCase(){return this.transformKeys(It.camelCase)}snakeCase(){return this.transformKeys(It.snakeCase)}constantCase(){return this.transformKeys(e=>(0,It.snakeCase)(e).toUpperCase())}describe(e){let r=(e?this.resolve(e):this).clone(),n=super.describe(e);n.fields={};for(let[i,s]of Object.entries(r.fields)){var o;let l=e;(o=l)!=null&&o.value&&(l=Object.assign({},l,{parent:l.value,value:l.value[i]})),n.fields[i]=s.describe(l)}return n}};Qe.prototype=qr.prototype;function Wf(t){return new Wr(t)}var Wr=class extends se{constructor(e){super({type:"array",spec:{types:e},check(r){return Array.isArray(r)}}),this.innerType=void 0,this.innerType=e}_cast(e,r){let n=super._cast(e,r);if(!this._typeCheck(n)||!this.innerType)return n;let o=!1,i=n.map((s,l)=>{let a=this.innerType.cast(s,Object.assign({},r,{path:`${r.path||""}[${l}]`}));return a!==s&&(o=!0),a});return o?i:n}_validate(e,r={},n,o){var i;let s=this.innerType,l=(i=r.recursive)!=null?i:this.spec.recursive;r.originalValue!=null&&r.originalValue,super._validate(e,r,n,(a,u)=>{var d;if(!l||!s||!this._typeCheck(u)){o(a,u);return}let c=new Array(u.length);for(let f=0;f<u.length;f++){var p;c[f]=s.asNestedTest({options:r,index:f,parent:u,parentPath:r.path,originalParent:(p=r.originalValue)!=null?p:e})}this.runTests({value:u,tests:c,originalValue:(d=r.originalValue)!=null?d:e,options:r},n,f=>o(f.concat(a),u))})}clone(e){let r=super.clone(e);return r.innerType=this.innerType,r}json(){return this.transform(Cs)}concat(e){let r=super.concat(e);return r.innerType=this.innerType,e.innerType&&(r.innerType=r.innerType?r.innerType.concat(e.innerType):e.innerType),r}of(e){let r=this.clone();if(!Gr(e))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+$e(e));return r.innerType=e,r.spec=Object.assign({},r.spec,{types:e}),r}length(e,r=Lr.length){return this.test({message:r,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(n){return n.length===this.resolve(e)}})}min(e,r){return r=r||Lr.min,this.test({message:r,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(n){return n.length>=this.resolve(e)}})}max(e,r){return r=r||Lr.max,this.test({message:r,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(n){return n.length<=this.resolve(e)}})}ensure(){return this.default(()=>[]).transform((e,r)=>this._typeCheck(e)?e:r==null?[]:[].concat(r))}compact(e){let r=e?(n,o,i)=>!e(n,o,i):n=>!!n;return this.transform(n=>n!=null?n.filter(r):n)}describe(e){let r=(e?this.resolve(e):this).clone(),n=super.describe(e);if(r.innerType){var o;let i=e;(o=i)!=null&&o.value&&(i=Object.assign({},i,{parent:i.value,value:i.value[0]})),n.innerType=r.innerType.describe(i)}return n}};Wf.prototype=Wr.prototype;function Yf(t){return new Yr(t)}var Yr=class extends se{constructor(e){super({type:"tuple",spec:{types:e},check(r){let n=this.spec.types;return Array.isArray(r)&&r.length===n.length}}),this.withMutation(()=>{this.typeError(xs.notType)})}_cast(e,r){let{types:n}=this.spec,o=super._cast(e,r);if(!this._typeCheck(o))return o;let i=!1,s=n.map((l,a)=>{let u=l.cast(o[a],Object.assign({},r,{path:`${r.path||""}[${a}]`}));return u!==o[a]&&(i=!0),u});return i?s:o}_validate(e,r={},n,o){let i=this.spec.types;super._validate(e,r,n,(s,l)=>{var a;if(!this._typeCheck(l)){o(s,l);return}let u=[];for(let[c,p]of i.entries()){var d;u[c]=p.asNestedTest({options:r,index:c,parent:l,parentPath:r.path,originalParent:(d=r.originalValue)!=null?d:e})}this.runTests({value:l,tests:u,originalValue:(a=r.originalValue)!=null?a:e,options:r},n,c=>o(c.concat(s),l))})}describe(e){let r=(e?this.resolve(e):this).clone(),n=super.describe(e);return n.innerType=r.spec.types.map((o,i)=>{var s;let l=e;return(s=l)!=null&&s.value&&(l=Object.assign({},l,{parent:l.value,value:l.value[i]})),o.describe(l)}),n}};Yf.prototype=Yr.prototype;var _isStrongPassword = require('validator/lib/isStrongPassword'); var _isStrongPassword2 = _interopRequireDefault(_isStrongPassword);function Lt(t){let u=t,{name:e,label:r,value:n,onChange:o}=u,i=H(u,["name","label","value","onChange"]),[s,l]=_react.useState.call(void 0, !1);function a(){l(!s)}return _jsxruntime.jsx.call(void 0, _material.TextField,y({name:e,label:r,value:n||"",onChange:o,type:s?"text":"password",InputProps:{endAdornment:_jsxruntime.jsx.call(void 0, _material.InputAdornment,{position:"start",children:_jsxruntime.jsx.call(void 0, _material.InputAdornment,{position:"end",children:_jsxruntime.jsx.call(void 0, _material.IconButton,{onClick:a,edge:"end",children:s?_jsxruntime.jsx.call(void 0, _iconsmaterial.VisibilityOff,{}):_jsxruntime.jsx.call(void 0, _iconsmaterial.Visibility,{})})})})}},i))}function et(t){let{isValid:e,message:r}=t,n=_material.useTheme.call(void 0, );return _jsxruntime.jsxs.call(void 0, _material.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[_jsxruntime.jsx.call(void 0, _iconsmaterial.Circle,{color:e?"success":"inherit",sx:{fontSize:"8pt"}}),_jsxruntime.jsx.call(void 0, _material.Typography,{variant:"body2",sx:{color:e?n.palette.success.main:"inherit",textDecoration:e?"line-through":"none",ml:1,fontSize:"10pt"},children:r})]})}var ks={senhaAtual:"",senhaNova:""},lp=Qe().shape({senhaAtual:Ie().required("Informe a Senha Atual."),senhaNova:Ie().required("Informe a Nova Senha.")});function Hr(t){let{isOpen:e,credentialsConfig:r,onClose:n,onSuccess:o,onFailed:i,primeiroAcesso:s,senhaAtual:l,email:a}=t,{alterarSenha:u,isSubmitting:d}=_hooks.useCredentials.call(void 0, r),{setValidationErrors:c,validationProps:p}=_hooks.useValidations.call(void 0, ),{data:f,handleChange:g,setData:x,changeValue:w}=_hooks.useForm.call(void 0, ks),[A,j]=_react.useState.call(void 0, !1),[ee,P]=_react.useState.call(void 0, null);_react.useEffect.call(void 0, ()=>{l&&w("senhaAtual",l)},[l]),_react.useEffect.call(void 0, ()=>{f.senhaNova&&j(_isStrongPassword2.default.call(void 0, f.senhaNova,{minLength:8,minLowercase:1,minUppercase:1,minNumbers:1,minSymbols:1}))},[f.senhaNova]);function D(){return ue(this,null,function*(){c(null),P(null),lp.validate(f,{abortEarly:!1}).then(()=>ue(this,null,function*(){var m;let{senhaAtual:b,senhaNova:k}=f;try{(yield u(b,k,a))&&(o&&o(),x(ks))}catch(h){if(i&&i(h),_axios.isAxiosError.call(void 0, h)){P((m=h.response)==null?void 0:m.data.message);return}P("Ocorreu um erro ao tentar alterar a senha")}})).catch(b=>{c(b)})})}function te(){return(f==null?void 0:f.senhaNova.length)>=8}function K(){if(f!=null&&f.senhaNova){let b=f==null?void 0:f.senhaNova.match(/[a-z]/g);return Array.isArray(b)&&b.length>0}return!1}function Y(){if(f!=null&&f.senhaNova){let b=f==null?void 0:f.senhaNova.match(/[A-Z]/g);return Array.isArray(b)&&b.length>0}return!1}function W(){if(f!=null&&f.senhaNova){let b=f==null?void 0:f.senhaNova.match(/\d/g);return Array.isArray(b)&&b.length>0}return!1}function v(){if(f!=null&&f.senhaNova){let b=f==null?void 0:f.senhaNova.match(/\W/g);return Array.isArray(b)&&b.length>0}return!1}return _jsxruntime.jsx.call(void 0, we,{title:"Atualizar senha",open:!!e,onClose:()=>n(),actions:_jsxruntime.jsxs.call(void 0, Ne,{children:[_jsxruntime.jsx.call(void 0, ne,{title:"Cancelar altera\xE7\xE3o de senha",color:"error",onClick:n,children:"Cancelar"}),_jsxruntime.jsx.call(void 0, ne,{title:"Confirmar altera\xE7\xE3o de senha",variant:"contained",onClick:D,isLoading:d,disabled:!A,children:"Alterar Senha"})]}),children:_jsxruntime.jsxs.call(void 0, _material.Grid,{container:!0,spacing:2,children:[s&&_jsxruntime.jsx.call(void 0, _material.Grid,{item:!0,xl:12,lg:12,md:12,sm:12,xs:12,children:_jsxruntime.jsxs.call(void 0, _material.Alert,{severity:"info",children:["Voc\xEA est\xE1 acessando o sistema com uma senha tempor\xE1ria.",_jsxruntime.jsx.call(void 0, "br",{}),"Cadastre uma senha segura para deixar sua conta mais protegida."]})}),_jsxruntime.jsx.call(void 0, _material.Grid,{item:!0,xl:12,lg:12,md:12,sm:12,xs:12,children:_jsxruntime.jsx.call(void 0, Lt,y({name:"senhaAtual",label:"Senha Atual",value:(f==null?void 0:f.senhaAtual)||"",onChange:g},p("senhaAtual")))}),_jsxruntime.jsx.call(void 0, _material.Grid,{item:!0,xl:12,lg:12,md:12,sm:12,xs:12,children:_jsxruntime.jsx.call(void 0, Lt,y({name:"senhaNova",label:"Nova Senha",value:(f==null?void 0:f.senhaNova)||"",onChange:g},p("senhaNova")))}),_jsxruntime.jsxs.call(void 0, _material.Grid,{item:!0,xl:12,lg:12,md:12,sm:12,xs:12,children:[_jsxruntime.jsx.call(void 0, et,{isValid:te(),message:"O tamanho m\xEDnimo da nova senha \xE9 de 8 caracteres"}),_jsxruntime.jsx.call(void 0, et,{isValid:K(),message:"A nova senha deve ter ao menos uma letra min\xFAscula"}),_jsxruntime.jsx.call(void 0, et,{isValid:Y(),message:"A nova senha deve ter ao menos uma letra mai\xFAscula"}),_jsxruntime.jsx.call(void 0, et,{isValid:W(),message:"A nova senha deve ter ao menos um n\xFAmero"}),_jsxruntime.jsx.call(void 0, et,{isValid:v(),message:"A nova senha deve ter ao menos um caracter especial"})]}),ee&&_jsxruntime.jsx.call(void 0, _material.Grid,{item:!0,xl:12,lg:12,md:12,sm:12,xs:12,children:_jsxruntime.jsx.call(void 0, _material.Alert,{severity:"error",children:ee})})]})})}var gp=Qe().shape({email:Ie().required("Informe o e-mail"),password:Ie().required("Informe a senha")});function po(t){let{onLoginSuccess:e,onLoginFailed:r,onEsqueciSenhaClick:n,credentialsConfig:o}=t,[i,s]=_react.useState.call(void 0, ""),[l,a]=_react.useState.call(void 0, ""),[u,d]=_react.useState.call(void 0, !1),[c,p]=_react.useState.call(void 0, !1),[f,g]=_react.useState.call(void 0, !1),[x,w]=_react.useState.call(void 0, !1),[A,j]=_react.useState.call(void 0, null),{login:ee}=_hooks.useCredentials.call(void 0, o),{validationProps:P,setValidationErrors:D}=_hooks.useValidations.call(void 0, );function te(){d(!u)}function K(){return ue(this,null,function*(){D(null),j(null),gp.validate({email:i,password:l},{abortEarly:!1}).then(()=>ue(this,null,function*(){var Y,W;p(!0);try{let v=yield ee(i,l);v&&e(v)}catch(v){if(_axios.isAxiosError.call(void 0, v)){if(((Y=v.response)==null?void 0:Y.data.code)==="E_FIRST_ACCESS"){g(!0);return}j((W=v.response)==null?void 0:W.data.message)}r(v)}})).catch(Y=>{D(Y)}).finally(()=>{p(!1)})})}return _jsxruntime.jsxs.call(void 0, _material.Box,{component:"form",children:[x&&_jsxruntime.jsxs.call(void 0, _material.Alert,{severity:"success",children:["Senha cadastrada com sucesso",_jsxruntime.jsx.call(void 0, "br",{}),"Tudo pronto para voc\xEA fazer o login"]}),_jsxruntime.jsx.call(void 0, _material.TextField,y({name:"email",label:"E-mail",margin:"normal",autoFocus:!0,value:i||"",onChange:Y=>s(Y.target.value)},P("email"))),_jsxruntime.jsx.call(void 0, _material.TextField,y({name:"password",label:"Senha",margin:"normal",value:l||"",onChange:Y=>a(Y.target.value),type:u?"text":"password",onKeyDown:Y=>Y.key==="Enter"&&K(),InputProps:{endAdornment:_jsxruntime.jsx.call(void 0, _material.InputAdornment,{position:"start",children:_jsxruntime.jsx.call(void 0, _material.InputAdornment,{position:"end",children:_jsxruntime.jsx.call(void 0, _material.IconButton,{onClick:te,edge:"end",children:u?_jsxruntime.jsx.call(void 0, _iconsmaterial.VisibilityOff,{}):_jsxruntime.jsx.call(void 0, _iconsmaterial.Visibility,{})})})})}},P("password"))),_jsxruntime.jsx.call(void 0, ne,{fullWidth:!0,variant:"contained",onClick:K,isLoading:c,sx:{mt:1},children:"Entrar"}),_jsxruntime.jsx.call(void 0, ne,{onClick:n,variant:"text",sx:{marginTop:.5,fontWeight:"400",":hover":{color:Y=>Y.palette.primary.dark}},children:"Esqueci a senha"}),A&&_jsxruntime.jsx.call(void 0, _material.Alert,{severity:"error",children:A}),_jsxruntime.jsx.call(void 0, Hr,{senhaAtual:l,email:i,primeiroAcesso:!0,isOpen:f,onClose:()=>g(!1),onSuccess:()=>{g(!1),w(!0),a("")},credentialsConfig:o})]})}var Tp=Qe().shape({email:Ie().required("Informe o e-mail")});function mo(t){let{onLoginClick:e,credentialsConfig:r}=t,[n,o]=_react.useState.call(void 0, ""),[i,s]=_react.useState.call(void 0, !1),[l,a]=_react.useState.call(void 0, !1),[u,d]=_react.useState.call(void 0, null),{recuperarSenha:c}=_hooks.useCredentials.call(void 0, r),{validationProps:p,setValidationErrors:f}=_hooks.useValidations.call(void 0, );function g(){return ue(this,null,function*(){f(null),Tp.validate({email:n},{abortEarly:!1}).then(()=>ue(this,null,function*(){var x;try{s(!0),yield c(n),a(!0)}catch(w){d((x=w.response)==null?void 0:x.data.message)}finally{s(!1)}})).catch(x=>{f(x)})})}return _jsxruntime.jsxs.call(void 0, _material.Box,{component:"form",children:[_jsxruntime.jsx.call(void 0, _material.TextField,y({name:"email",label:"E-mail",margin:"normal",placeholder:"Informe o e-mail utilizado para acessar o sistema",autoFocus:!0,value:n||"",onChange:x=>o(x.target.value)},p("email"))),_jsxruntime.jsxs.call(void 0, Ne,{sx:{display:"inline-flex",justifyContent:"space-between",width:"100%",marginTop:1},children:[_jsxruntime.jsx.call(void 0, ne,{onClick:e,variant:"text",sx:{fontWeight:"400",":hover":{color:x=>x.palette.primary.dark}},children:"Voltar"}),_jsxruntime.jsx.call(void 0, ne,{variant:"contained",onClick:g,isLoading:i,children:"Recuperar Senha"})]}),l&&_jsxruntime.jsx.call(void 0, _material.Alert,{severity:"success",action:_jsxruntime.jsx.call(void 0, ne,{onClick:e,variant:"text",sx:{fontWeight:"400",":hover":{color:x=>x.palette.primary.dark}},children:"Ir para o Login"}),children:"Enviamos para o seu e-mail as instru\xE7\xF5es para recuperar a sua senha"}),u&&_jsxruntime.jsx.call(void 0, _material.Alert,{severity:"error",children:u})]})}function go(t){var d;let{loginData:e,credentialsConfig:r,onLoginFailed:n,onLoginSuccess:o}=t,[i,s]=_react.useState.call(void 0, ""),{selecionarLicenca:l,isSubmitting:a}=_hooks.useCredentials.call(void 0, r);_react.useEffect.call(void 0, ()=>{if(Array.isArray(e==null?void 0:e.empresas)){let c=e==null?void 0:e.empresas[0];s(c==null?void 0:c.uuid)}},[e]);function u(){return ue(this,null,function*(){try{let c=yield l(e,i);c?o(c):n("Nenhuma token definida")}catch(c){n(c)}})}return _jsxruntime.jsxs.call(void 0, _material.Box,{component:"form",sx:{minWidth:"290px"},children:[_jsxruntime.jsx.call(void 0, _material.TextField,{label:"Licen\xE7as",margin:"normal",select:!0,autoFocus:!0,value:i,onChange:c=>{s(c.target.value)},children:(d=e==null?void 0:e.empresas)==null?void 0:d.map(c=>_jsxruntime.jsx.call(void 0, _material.MenuItem,{value:c.uuid,children:c.nome},c.uuid))}),_jsxruntime.jsx.call(void 0, ne,{fullWidth:!0,variant:"contained",onClick:u,isLoading:a,sx:{mt:1},children:"Confirmar"})]})}function Is(t){var x;let{credentialsConfig:e,onLoginSuccess:r,onLoginFailed:n,onAlreadyLogged:o,appName:i}=t,[s,l]=_react.useState.call(void 0, ),{selecionarLicenca:a,isAuthenticated:u}=_hooks.useCredentials.call(void 0, e),[d,c]=_react.useState.call(void 0, !1);_react.useEffect.call(void 0, ()=>{u&&o&&o()},[u]);function p(w){return ue(this,null,function*(){try{if(Array.isArray(w==null?void 0:w.empresas)){if((w==null?void 0:w.empresas.length)===1){let A=yield a(w,w.empresas[0].uuid);A&&r(A);return}l(w);return}r(w)}catch(A){n(A)}})}function f(w){return ue(this,null,function*(){n(w)})}function g(){c(!d)}return _jsxruntime.jsx.call(void 0, _material.Box,{sx:{height:"100vh"},children:_jsxruntime.jsxs.call(void 0, _material.Container,{component:"main",maxWidth:"xs",sx:{height:"80%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2},children:[_jsxruntime.jsx.call(void 0, "img",{src:"https://datac-site-assets.s3.sa-east-1.amazonaws.com/logo.png"}),_jsxruntime.jsx.call(void 0, _material.Paper,{children:_jsxruntime.jsxs.call(void 0, _material.Stack,{sx:{padding:5},children:[_jsxruntime.jsx.call(void 0, to,{label:i}),!d&&_jsxruntime.jsx.call(void 0, _material.Box,{sx:{marginTop:3},children:s!=null&&s.empresas&&((x=s==null?void 0:s.empresas)==null?void 0:x.length)>0?_jsxruntime.jsx.call(void 0, go,{loginData:s,credentialsConfig:e,onLoginSuccess:r,onLoginFailed:n}):_jsxruntime.jsx.call(void 0, po,{credentialsConfig:e,onLoginSuccess:p,onLoginFailed:f,onEsqueciSenhaClick:g})}),d&&_jsxruntime.jsx.call(void 0, _material.Box,{sx:{marginTop:3},children:_jsxruntime.jsx.call(void 0, mo,{onLoginClick:g,credentialsConfig:e})})]})})]})})}var Lp=t=>({transition:t.transitions.create(["transform"],{duration:500})}),jp=_styles.styled.call(void 0, _iconsmaterial.KeyboardArrowRight,{shouldForwardProp:t=>t!=="open"})(({theme:t,open:e})=>y(y(y({color:t.palette.primary.dark},Lp(t)),e&&{transform:"rotate(-180deg)"}),!e&&{transform:"rotate(0)"}));function bo(t){let{open:e,onToogleDrawerMenu:r}=t;return _jsxruntime.jsx.call(void 0, _material.Stack,{width:"90%",direction:"row",justifyContent:e?"flex-end":"center",margin:"16px auto",children:_jsxruntime.jsx.call(void 0, _material.IconButton,{size:"small","aria-label":"open drawer",onClick:r,children:_jsxruntime.jsx.call(void 0, jp,{fontSize:"small",open:e})})})}var Vp=_styles.styled.call(void 0, _material.MenuItem,{})(({theme:t})=>({borderRadius:"6px",width:"90%",gap:"16px",margin:"0 auto",padding:"8px 16px",transition:"0.1s ease-in-out","&:hover":{backgroundColor:"rgba(89, 195, 224, 15%);","& .MuiTypography-root":{color:t.palette.primary.main},"& .MuiSvgIcon-root":{color:t.palette.primary.main},"& .MuiIcon-root":{color:t.palette.primary.main}},"& .MuiIcon-root":{color:t.palette.grey[500],fontSize:"20px"},"& .MuiTypography-root":{letterSpacing:"0.5px",color:t.palette.text.secondary,fontSize:t.typography.body1},"& .MuiSvgIcon-root":{fontSize:"24px"}})),Up=t=>_jsxruntime.jsx.call(void 0, Vp,y({},t)),Xr=Up;function vo(t){let{menuItem:e,activeMenu:r,onMenuClick:n}=t,[o,i]=_react.useState.call(void 0, !1);if(!e.visible)return null;let s=!!(e!=null&&e.items&&(e==null?void 0:e.items.length)>0);function l(){i(!o)}return _jsxruntime.jsxs.call(void 0, _material.Box,{children:[_jsxruntime.jsxs.call(void 0, Xr,{onClick:()=>{if(e!=null&&e.link){n(e.link);return}l()},selected:r===e.link,children:[!!e.icon&&_jsxruntime.jsx.call(void 0, _material.Icon,{children:e.icon}),_jsxruntime.jsx.call(void 0, _material.ListItemText,{primary:e.label}),s&&!o&&_jsxruntime.jsx.call(void 0, _iconsmaterial.ExpandMore,{}),s&&o&&_jsxruntime.jsx.call(void 0, _iconsmaterial.ExpandLess,{})]}),(e==null?void 0:e.items)&&_jsxruntime.jsx.call(void 0, _material.Collapse,{in:o,timeout:"auto",unmountOnExit:!0,children:_jsxruntime.jsx.call(void 0, rt,{activeMenu:r,sx:{pl:a=>a.spacing(1.5)},menus:(e==null?void 0:e.items)||[],onMenuClick:n})})]})}function rt(t){let i=t,{menus:e,activeMenu:r,onMenuClick:n}=i,o=H(i,["menus","activeMenu","onMenuClick"]);return _jsxruntime.jsx.call(void 0, _material.List,N(y({component:"nav",disablePadding:!0},o),{children:e.map(s=>_jsxruntime.jsx.call(void 0, vo,{onMenuClick:n,activeMenu:r,menuItem:s},s.id))}))}function To(t){let{menus:e,activeMenu:r,onMenuClick:n}=t,[o,i]=_react.useState.call(void 0, null),s=(a,u,d)=>{i({element:a.currentTarget,id:u,items:d})},l=()=>{i(null)};return _jsxruntime.jsx.call(void 0, _material.List,{component:"nav",disablePadding:!0,children:e.map(a=>a.visible?_jsxruntime.jsxs.call(void 0, Xr,{onMouseEnter:u=>{a!=null&&a.link||s(u,a.id,a.items)},onMouseLeave:()=>{a!=null&&a.link||l()},onClick:()=>{a!=null&&a.link&&n(a.link)},selected:r===a.link,children:[_jsxruntime.jsx.call(void 0, _material.ListItemIcon,{children:_jsxruntime.jsx.call(void 0, _material.Icon,{children:a.icon})}),(o==null?void 0:o.id)===a.id&&_jsxruntime.jsx.call(void 0, _material.Popper,{sx:{zIndex:999999},anchorEl:o==null?void 0:o.element,open:!!(o!=null&&o.element),placement:"right-start",children:_jsxruntime.jsx.call(void 0, rt,{activeMenu:r,onMenuClick:n,menus:(a==null?void 0:a.items)||[],sx:{minWidth:"240px",backgroundColor:L.palette.background.paper,borderRadius:"12px",padding:"16px 4px",boxShadow:"0px 5px 5px -3px rgb(0 0 0 / 20%), 0px 8px 10px 1px rgb(0 0 0 / 14%), 0px 3px 14px 2px rgb(0 0 0 / 12%);"}})})]},`minMenu-${a.id}`):null)})}var Ns=(t,e)=>({width:t,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:"hidden"}),zs=t=>({transition:t.transitions.create("width",{easing:t.transitions.easing.sharp,duration:t.transitions.duration.leavingScreen}),overflowX:"hidden",width:`calc(${t.spacing(8)} + 1px)`,[t.breakpoints.up("sm")]:{width:`calc(${t.spacing(8)} + 1px)`}}),fd=_styles.styled.call(void 0, _material.Drawer,{shouldForwardProp:t=>t!=="open"&&t!=="width"})(({theme:t,open:e,width:r})=>y(y({width:r,bgcolor:t.palette.background.paper,boxShadow:"2px 3px 20px -16px rgb(32 32 36 / 30%)",borderRightStyle:"none",whiteSpace:"nowrap",boxSizing:"border-box"},e&&N(y({},Ns(r,t)),{"& .MuiDrawer-paper":Ns(r,t)})),!e&&N(y({},zs(t)),{"& .MuiDrawer-paper":zs(t)})));function Vs(t){let g=t,{open:e,items:r,width:n,logo:o,minLogo:i,label:s,minLabel:l,link:a,version:u,activeMenu:d,onMenuClick:c,toggleMenu:p}=g,f=H(g,["open","items","width","logo","minLogo","label","minLabel","link","version","activeMenu","onMenuClick","toggleMenu"]);return _jsxruntime.jsxs.call(void 0, fd,N(y({width:n,open:e,onClose:()=>p(!1)},f),{children:[_jsxruntime.jsx.call(void 0, _material.Box,{sx:{height:L.mixins.toolbar},children:_jsxruntime.jsxs.call(void 0, _material.Stack,{spacing:.5,alignItems:"center",p:1,children:[_jsxruntime.jsx.call(void 0, "img",{src:e?o:i,alt:"logo"}),_jsxruntime.jsxs.call(void 0, _material.Typography,{variant:"body2",fontWeight:e?"700":"400",children:[e?s:l," ",u&&_jsxruntime.jsx.call(void 0, _material.Link,{underline:"none",target:"_blank",rel:"noreferrer",href:a,children:u})]})]})}),_jsxruntime.jsx.call(void 0, bo,{open:!!e,onToogleDrawerMenu:p}),e&&_jsxruntime.jsx.call(void 0, rt,{onMenuClick:c,activeMenu:d,menus:r}),!e&&_jsxruntime.jsx.call(void 0, To,{onMenuClick:c,activeMenu:d,menus:r})]}))}function Ys(t){let{typographyProps:e,onChange:r,value:n,displayEditButton:o,displaySaveButton:i,textFieldProps:s}=t,w=s||{},{InputProps:l,value:a,onKeyDown:u,onChange:d}=w,c=H(w,["InputProps","value","onKeyDown","onChange"]),[p,f]=_react.useState.call(void 0, !1),[g,x]=_react.useState.call(void 0, );return _react.useEffect.call(void 0, ()=>{x(n)},[n]),_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[!p&&_jsxruntime.jsxs.call(void 0, _material.Stack,{direction:"row",alignItems:"center",spacing:1,children:[_jsxruntime.jsx.call(void 0, _material.Typography,N(y({onClick:()=>{f(!0)}},e),{children:g})),o&&_jsxruntime.jsx.call(void 0, _material.IconButton,{onClick:()=>{f(!0)},children:_jsxruntime.jsx.call(void 0, _iconsmaterial.Edit,{})})]}),p&&_jsxruntime.jsx.call(void 0, _material.ClickAwayListener,{onClickAway:()=>f(!1),children:_jsxruntime.jsx.call(void 0, _material.TextField,y({autoFocus:!0,value:g,onKeyDown:A=>{A.key==="Enter"&&(r(g),f(!1)),A.key==="Escape"&&(x(n),f(!1))},onChange:A=>{let j=A.target.value;x(j)},InputProps:{endAdornment:i&&_jsxruntime.jsx.call(void 0, _material.InputAdornment,{position:"end",children:_jsxruntime.jsx.call(void 0, _material.IconButton,{onClick:()=>{n!=g&&r(g),f(!1)},edge:"end",children:n!=g?_jsxruntime.jsx.call(void 0, _iconsmaterial.Save,{}):_jsxruntime.jsx.call(void 0, _iconsmaterial.Cancel,{})})})}},c))})]})}exports.AlterarSenha = Hr; exports.Button = ne; exports.ButtonContainer = Ne; exports.Checkbox = _o; exports.ColorsGrid = Fo; exports.CurrencyCellStyle = Ym; exports.CurrencyTextField = un; exports.DataTable = el; exports.DataTableOptions = mn; exports.DeleteContainer = pn; exports.Dialog = we; exports.DrawerMenu = Vs; exports.Editable = Ys; exports.FilterContainer = vn; exports.FilterControl = Yt; exports.Flag = Ko; exports.FormContainer = Sn; exports.LabelValue = Yi; exports.MioAuth = Is; exports.OptionStyles = Wm; exports.PageTitle = Zi; exports.PasswordTextField = Lt; exports.SearchTextField = Rr; exports.Tooltip = it; exports.Transporter = eo; exports.theme = L;
10
10
  /*! Bundled license information:
11
11
 
12
12
  react-is/cjs/react-is.production.min.js: