PageSourceSearch

https://morandoembarao.com/_next/static/chunks/pages/painel/corretores-2de3129a75152952.js

js morandoembarao.com collected 2026-10-07 11:41:07 UTC 26,136 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5648],{73465:function(e,t,r){"use strict";r.d(t,{OK:function(){return E},cb:function(){return H},mQ:function(){return k},nP:function(){return A},td:function(){return _},x4:function(){return P}});var n=r(81439),i=r(44592),a=r(67294),o=r(87096),s=r(40242),l=r(97375),c=r(44697),d=r(26450);function u(){return(u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function h(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}var x=["defaultIndex","onChange","index","isManual","isLazy","lazyBehavior","orientation","direction"],p=["isDisabled","isFocusable"],m=["isSelected","id","children"],f=(0,s.n)(),g=f[0],b=f[1],v=f[2],j=f[3],y=(0,d.kr)({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within <Tabs />"}),C=y[0],w=y[1];function I(e,t){return e+"--tabpanel-"+t}var z=["children","className"],S=["htmlProps","descendants"],k=(0,n.Gp)(function(e,t){var r,o,s,c,d,p,m,f,b,j,y,w,I,k,E,_,P,A=(0,n.jC)("Tabs",e),H=(0,n.Lr)(e),T=H.children,N=H.className,F=(o=(r=h(H,z)).defaultIndex,s=r.onChange,c=r.index,d=r.isManual,p=r.isLazy,m=r.lazyBehavior,f=r.orientation,b=r.direction,j=h(r,x),w=(y=a.useState(null!=o?o:0))[0],I=y[1],E=(k=(0,l.Tx)({defaultValue:null!=o?o:0,value:c,onChange:s}))[0],_=k[1],a.useEffect(function(){null!=c&&I(c)},[c]),P=v(),{id:(0,l.Me)(r.id,"tabs"),selectedIndex:E,focusedIndex:w,setSelectedIndex:_,setFocusedIndex:I,isManual:d,isLazy:p,lazyBehavior:void 0===m?"unmount":m,orientation:void 0===f?"horizontal":f,descendants:P,direction:void 0===b?"ltr":b,htmlProps:j}),O=F.htmlProps,R=F.descendants,D=h(F,S),M=a.useMemo(function(){return D},[D]),B=(0,i.CE)(O,["isFitted"]);return a.createElement(g,{value:R},a.createElement(C,{value:M},a.createElement(n.Fo,{value:A},a.createElement(n.m$.div,u({className:(0,i.cx)("chakra-tabs",N),ref:t},B,{__css:A.root}),T))))});i.Ts&&(k.displayName="Tabs");var E=(0,n.Gp)(function(e,t){var r,s,l,c,x,m,f,g,b,v,y,C,z,S,k,E=(0,n.yK)(),_=(s=(r=u({},e,{ref:t})).isDisabled,l=r.isFocusable,c=h(r,p),m=(x=w()).setSelectedIndex,f=x.isManual,g=x.id,b=x.setFocusedIndex,v=x.selectedIndex,C=(y=j({disabled:s&&!l})).index,z=y.register,S=C===v,k=(0,o.h)(u({},c,{ref:(0,d.lq)(z,r.ref),isDisabled:s,isFocusable:l,onClick:(0,i.v0)(r.onClick,function(){m(C)})})),u({},k,{id:g+"--tab-"+C,role:"tab",tabIndex:S?0:-1,type:"button","aria-selected":S,"aria-controls":I(g,C),onFocus:s?void 0:(0,i.v0)(r.onFocus,function(){b(C);var e=s&&l;f||e||m(C)})})),P=u({outline:"0",display:"flex",alignItems:"center",justifyContent:"center"},E.tab);return a.createElement(n.m$.button,u({},_,{className:(0,i.cx)("chakra-tabs__tab",e.className),__css:P}))});i.Ts&&(E.displayName="Tab");var _=(0,n.Gp)(function(e,t){var r,o,s,l,c,d,h,x=(r=u({},e,{ref:t}),s=(o=w()).focusedIndex,l=o.orientation,c=o.direction,d=b(),h=a.useCallback(function(e){var t,r=function(){var e=d.nextEnabled(s);e&&(0,i.T_)(e.node)},n=function(){var e=d.prevEnabled(s);e&&(0,i.T_)(e.node)},a="horizontal"===l,o="vertical"===l,u=(0,i.uh)(e),h="ltr"===c?"ArrowLeft":"ArrowRight",x="ltr"===c?"ArrowRight":"ArrowLeft",p=((t={})[h]=function(){return a&&n()},t[x]=function(){return a&&r()},t.ArrowDown=function(){return o&&r()},t.ArrowUp=function(){return o&&n()},t.Home=function(){var e=d.firstEnabled();e&&(0,i.T_)(e.node)},t.End=function(){var e=d.lastEnabled();e&&(0,i.T_)(e.node)},t)[u];p&&(e.preventDefault(),p(e))},[d,s,l,c]),u({},r,{role:"tablist","aria-orientation":l,onKeyDown:(0,i.v0)(r.onKeyDown,h)})),p=(0,n.yK)(),m=u({display:"flex"},p.tablist);return a.createElement(n.m$.div,u({},x,{className:(0,i.cx)("chakra-tabs__tablist",e.className),__css:m}))});i.Ts&&(_.displayName="TabList");var P=(0,n.Gp)(function(e,t){var r,o,s,l,c,d,x,p,f,g,b=(o=(r=u({},e,{ref:t})).isSelected,s=r.id,l=r.children,c=h(r,m),x=(d=w()).isLazy,p=d.lazyBehavior,f=a.useRef(!1),o&&(f.current=!0),g=(0,i.VI)({hasBeenSelected:f.current,isSelected:o,isLazy:x,lazyBehavior:p}),u({tabIndex:0},c,{children:g?l:null,role:"tabpanel",hidden:!o,id:s})),v=(0,n.yK)();return a.createElement(n.m$.div,u({outline:"0"},b,{className:(0,i.cx)("chakra-tabs__tab-panel",e.className),__css:v.tabpanel}))});i.Ts&&(P.displayName="TabPanel");var A=(0,n.Gp)(function(e,t){var r,o,s,l,c=(o=(r=w()).id,s=r.selectedIndex,l=(0,d.WR)(e.children).map(function(e,t){return a.cloneElement(e,{isSelected:t===s,id:I(o,t),"aria-labelledby":o+"--tab-"+t})}),u({},e,{children:l})),h=(0,n.yK)();return a.createElement(n.m$.div,u({},c,{width:"100%",ref:t,className:(0,i.cx)("chakra-tabs__tab-panels",e.className),__css:h.tabpanels}))});i.Ts&&(A.displayName="TabPanels");var H=(0,n.Gp)(function(e,t){var r,o,s,l,d,h,x,p,m,f,g,v,j=(r=w(),o=b(),s=r.selectedIndex,d="horizontal"===(l=r.orientation),h="vertical"===l,p=(x=a.useState(function(){return d?{left:0,width:0}:h?{top:0,height:0}:void 0}))[0],m=x[1],g=(f=a.useState(!1))[0],v=f[1],(0,c.a)(function(){if(!(0,i.o8)(s)){var e=o.item(s);if(!(0,i.o8)(e)){d&&m({left:e.node.offsetLeft,width:e.node.offsetWidth}),h&&m({top:e.node.offsetTop,height:e.node.offsetHeight});var t=requestAnimationFrame(function(){v(!0)});return function(){t&&cancelAnimationFrame(t)}}}},[s,d,h,o]),u({position:"absolute",transitionProperty:"left, right, top, bottom, height, width",transitionDuration:g?"200ms":"0ms",transitionTimingFunction:"cubic-bezier(0, 0, 0.2, 1)"},p)),y=u({},e.style,j),C=(0,n.yK)();return a.createElement(n.m$.div,u({ref:t},e,{className:(0,i.cx)("chakra-tabs__tab-indicator",e.className),style:y,__css:C.indicator}))});i.Ts&&(H.displayName="TabIndicator")},86011:function(e,t,r){var n=r(77694).w_;e.exports=function(e){return n({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"
1currentColor"},child:[{tag:"path",attr:{d:"M20,2H8C6.897,2,6,2.897,6,4v12c0,1.103,0.897,2,2,2h12c1.103,0,2-0.897,2-2V4C22,2.897,21.103,2,20,2z M8,16V4h12 l0.002,12H8z"}},{tag:"path",attr:{d:"M4 8H2v12c0 1.103.897 2 2 2h12v-2H4V8zM15 6L13 6 13 9 10 9 10 11 13 11 13 14 15 14 15 11 18 11 18 9 15 9z"}}]})(e)}},24051:function(e,t,r){var n=r(77694).w_;e.exports=function(e){return n({tag:"svg",attr:{viewBox:"0 0 448 512",fill:"currentColor"},child:[{tag:"path",attr:{d:"M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z"}}]})(e)}},9304:function(e,t,r){var n=r(77694).w_;e.exports=function(e){return n({tag:"svg",attr:{version:"1.1",id:"mdi-camera-plus-outline",viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M21 6H17.8L16 4H10V6H15.1L17 8H21V20H5V11H3V20C3 21.1 3.9 22 5 22H21C22.1 22 23 21.1 23 20V8C23 6.9 22.1 6 21 6M8 14C8 18.45 13.39 20.69 16.54 17.54C19.69 14.39 17.45 9 13 9C10.24 9 8 11.24 8 14M13 11C14.64 11.05 15.95 12.36 16 14C15.95 15.64 14.64 16.95 13 17C11.36 16.95 10.05 15.64 10 14C10.05 12.36 11.36 11.05 13 11M5 6H8V4H5V1H3V4H0V6H3V9H5"}}]})(e)}},44658:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/painel/corretores",function(){return r(77102)}])},20506:function(e,t,r){"use strict";var n=r(93073),i=r(56845);t.Z=(e,t,r,a)=>new Promise(o=>{var s=(0,i.iH)(n.tO,e+r+".jpg");let l=(0,i.B0)(s,t,{contentType:"image/jpeg"});l.on("state_changed",function(e){switch(console.log("Upload is "+e.bytesTransferred/e.totalBytes*100+"% done"),e.state){case"paused":console.log("Upload is paused");break;case"running":console.log("Upload is running")}},function(e){switch(e.code){case"storage/unauthorized":console.log("storage/unauthorized");break;case"storage/canceled":console.log("user canceled the upload");break;case"storage/unknown":console.log("unknown storage error")}},function(){(0,i.Jt)(l.snapshot.ref).then(e=>{o(a(e))})})})},83558:function(e,t){"use strict";t.Z=e=>new Date(e).toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit",year:"numeric"})},77102:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return er}});var n=r(85893),i=r(67294),a=r(15437),o=r(10974),s=r(91665),l=r(39828),c=r(68527),d=r(73465),u=r(93073),h=r(4612),x=r(74221),p=r(31835),m=r.n(p),f=r(11981),g=r.n(f),b=e=>{let{items:t,keys:r,results:a,setResults:o,noSortFn:s}=e,[l,d]=(0,i.useState)(""),u=new x.Z(t,{includeScore:!0,keys:r}),p=e=>{d(e),a[0]&&""!=l&&o(u.search(e).map(e=>({...e.item,score:e.item.score})).sort((e,t)=>e.score-t.score))};return""===l&&o(t.sort(s)),(0,n.jsxs)(h.BZ,{maxW:["190px","190px","250px","250px"],size:"sm",children:[(0,n.jsx)(h.Z8,{pointerEvents:"none",children:(0,n.jsx)(m(),{color:"gray.400"})}),(0,n.jsx)(h.II,{value:l,placeholder:"Procurar",borderRadius:"5px",onChange:e=>p(e.target.value)}),l&&(0,n.jsx)(h.xH,{onClick:()=>d(""),children:(0,n.jsx)(c.xu,{bg:"orange.400",cursor:"pointer",borderRadius:"2px",children:(0,n.jsx)(g(),{color:"gray.100"})})})]})};r(30653);var v=r(53416),j=r(35074),y=r(51134),C=r(10894),w=r(34651),I=r(11391),z=r(33441),S=r(15193);r(99434),r(20945),r(90566),r(13430),r(49555);var k=r(95578),E=r(83558),_=e=>{let{Data:t,setData:r,isEditingUsername:a,setIsEditingUsername:o}=e,[s,d]=(0,i.useState)(""),[x,p]=(0,i.useState)(!1),m=(0,j.pm)(),f=()=>{p(!1),m({title:"Item Atualizado",position:"top",description:"Informa\xe7\xf5es Salvas",status:"success",duration:2500,isClosable:!0})},g=e=>{p(!1),console.log(e),m({title:"Aconteceu um erro :(",position:"top",description:JSON.stringify(e),status:"error",duration:2500,isClosable:!0})},b=()=>{d(t.username),o(!0)},v=()=>{r({...t,username:s}),o(!1)},y=async()=>{let e=t.username;if(!e){alert("\xc9 preciso preencher um username"),console.error("Username is required");return}try{let r=(0,l.hJ)(u.db,"users"),n=(0,l.IO)(r,(0,l.ar)("username","==",e));(await (0,l.PL)(n)).empty?((0,k.$G)({id:t.uid,...t},"users",f,g),alert("Username alterado"),o(!1)):alert("Username j\xe1 existe, por favor escolha outro")}catch(e){alert(e),console.error("Error checking username:",e)}};return(0,n.jsxs)(c.kC,{mb:"10px",alignItems:"flex-end",gridGap:"5px",children:[(0,n.jsxs)(c.xu,{children:[(0,n.jsx)(c.xu,{fontSize:"13px",children:"Username"}),(0,n.jsxs)(h.BZ,{size:"sm",children:[(0,n.jsx)(h.Ui,{children:"@"}),(0,n.jsx)(h.II,{disabled:!a,value:t.username,maxW:"200px",onChange:e=>r({...t,username:e.target.value.toLowerCase()}),bg:"white"})]})]}),(0,n.jsx)(c.xu,{mb:"4px",children:a?(0,n.jsxs)(c.kC,{children:[(0,n.jsx)(S.zx,{size:"xs",onClick:()=>y(),colorScheme:"blue",mr:"5px",children:"Salvar"}),(0,n.jsx)(S.zx,{size:"xs",variant:"outline",onClick:()=>v(),colorScheme:"blue",children:"Cancelar"})]}):(0,n.jsx)(S.zx,{size:"xs",onClick:()=>b(),colorScheme:"blue",children:"Editar"})})]})},P=r(41664),A=r.n(P),H=r(57333),T=r(32095),N=r(24051),F=r.n(N),O=r(20506),R=r(76770),D=r.n(R),M=r(86011),B=r.n(M);let L=(0,a.ZP)("input").withConfig({componentId:"sc-4bd4ceaf-0"})(["display:none;"]),U=(0,a.ZP)("label").withConfig({componentId:"sc-4bd4ceaf-1"})(["border-radius:5px;font-size:14px;cursor:pointer;color:white;"]);var Z=e=>{let{ButtonComponent:t,setUris:r,multiple:i,maxWidth:a,maxHeight:o,labelId:s}=e,l=e=>new Promise(t=>{D().imageFileResizer(e,a,o,"JPEG",100,0,e=>{t(e)},"blob")}),d=e=>{let t=Array.from(e.target.files),n=[],i=0;t[0]&&t.forEach(async e=>{let a=await l(e);n.push(URL.createObjectURL(a)),(i+=1)==t.length&&r(n)})};return(0,n.jsxs)(c.xu,{children:[(0,n.jsx)(U,{for:s,children:t||(0,n.jsx)(C.JO,{w:"50px",h:"50px",as:B(),color:"gray.500",cursor:"pointer"})}),(0,n.jsx)(L,{id:s,type:"file",multiple:i,onChange:e=>d(e)})]})},V=r(56845),G=e=>{let{ButtonComponent:t,RenderComponent:r,Data:i,setData:a,updateItem:o,imgW:s,imgH:d,multiple:h,storagePath:x,dbArrItem:p,dbPath:m,maxImgs:f,isCreating:g,setIsCreating:b,createItem:y,doing:I,setDoing:z}=e,k=(0,j.pm)(),E=e=>{z(!0);let t=e.slice(0,f).map(e=>({id:(0,v.x0)(10),uri:e,ordem:0})),r=[],n=0;t.forEach(async e=>{let s=e.uri?await fetch(e.uri).then(e=>e.blob()):"";await (0,O.Z)(x,s,e.id,function(t){r.push({id:e.id,url:t,ordem:e.ordem})}),(n+=1)===t.length&&(g?y({...i,[p]:i[p]?[...i[p],...r]:r}):o({...i,[p]:i[p]?[...i[p],...r]:r}),a({...i,[p]:i[p]?[...i[p],...r]:r}),z(!1))})},_=e=>{z(!0);let t=(0,V.iH)(u.tO,x+e+".jpg");(0,V.oq)(t).then(()=>{(0,l.r7)((0,l.JU)(u.db,m,i.id),{...i,[p]:[...i[p].filter(t=>t.id!=e)]}).then(()=>{z(!1),k({title:"Item Deletado",position:"top",description:"Informa\xe7\xf5es Removidas",status:"success",duration:2500,isClosable:!0}),a({...i,[p]:[...i[p].filter(t=>t.id!=e)]})}).catch(e=>{z(!1),console.log(e),k({title:"Ocorreu um erro",position:"top",description:"Erro :"+e,status:"error",duration:2500,isClosable:!0})})}).catch(function(e){console.log(e)})};return(0,n.jsx)(c.kC,{opacity:I?"0.4":"1",pointerEvents:I?"none":"auto",children:(0,n.jsxs)(c.kC,{flexWrap:"wrap",gridGap:"5px",children:[(!(i[p]&&i[p].length>
10)||!0===h)&&(0,n.jsx)(c.kC,{mr:"5px",w:"100%",justifyContent:"center",alignItems:"center",children:(0,n.jsx)(Z,{ButtonComponent:t,maxWidth:s,maxHeight:d,multiple:h,labelId:p,setUris:e=>E(e)})}),i[p]&&i[p].map(e=>(0,n.jsxs)(c.xu,{w:"100%",position:"relative",children:[r||(0,n.jsx)(w.Ee,{src:e.url,alt:"Imagem produto",w:"300px",h:"200px",borderRadius:"5px",objectFit:"cover"}),(0,n.jsx)(c.kC,{justifyContent:"space-between",position:"absolute",bottom:"4px",left:"2px",children:(0,n.jsxs)(T.J2,{children:[(0,n.jsx)(T.xo,{children:(0,n.jsx)(c.Ct,{size:"xs",cursor:"pointer",bg:"gray.300",children:(0,n.jsx)(C.JO,{w:"15px",h:"15px",p:"1px",as:F(),color:"gray.500",cursor:"pointer"})})}),(0,n.jsxs)(T.yk,{zIndex:4,children:[(0,n.jsx)(T.QH,{}),(0,n.jsx)(T.us,{}),(0,n.jsx)(T.Yt,{fontSize:"14px",fontWeight:"bold",children:"Excluir imagem"}),(0,n.jsx)(T.b,{fontSize:"14px",children:"Tem certeza que deseja remover a imagem?"}),(0,n.jsx)(S.zx,{size:"xs",colorScheme:"red",onClick:()=>_(e.id),margin:"5px",children:"Remover"})]})]})})]},e.id))]})})},J=r(9304),W=r.n(J);let $=a.ZP.div.withConfig({componentId:"sc-f6ff47e7-0"})(["font-size:14px;color:grey;"]),K=a.ZP.div.withConfig({componentId:"sc-f6ff47e7-1"})(["width:100%;"]),q=a.ZP.div.withConfig({componentId:"sc-f6ff47e7-2"})(["max-width:100%;margin-left:30px;"]);var Q=e=>{var t,r,a,o;let{modalOpen:s,setModalOpen:l,itemData:d,closeModal:u,isCreating:x,setIsCreating:p}=e,[m,f]=(0,i.useState)(d),[g,b]=(0,i.useState)(!1),[P,T]=(0,i.useState)(!1),N=(0,j.pm)();(0,i.useEffect)(()=>{(d.uid||d.id)&&(f(d),l(!0))},[d]),(0,i.useEffect)(()=>{!0===x&&f({...m,id:(0,v.x0)(10),createdBy:"doce-na-medida"})},[x]);let F=()=>{b(!1)},O=()=>{b(!1),p(!1),N({title:"Item Atualizado",position:"top",description:"Informa\xe7\xf5es Salvas",status:"success",duration:2500,isClosable:!0})},R=e=>{b(!1),console.log(e),N({title:"Aconteceu um erro :(",position:"top",description:JSON.stringify(e),status:"error",duration:2500,isClosable:!0})};return(0,n.jsxs)(y.u_,{isOpen:s,onClose:()=>u(),size:"5xl",children:[(0,n.jsx)(y.ZA,{}),(0,n.jsxs)(y.hz,{children:[(0,n.jsx)(y.xB,{children:"Editar/Enviar Item"}),(0,n.jsx)(y.ol,{}),(0,n.jsx)(y.fe,{children:(0,n.jsx)(K,{children:m&&(0,n.jsxs)(q,{children:[m.id?(0,n.jsxs)(c.xu,{mb:"10px",children:[(0,n.jsx)($,{children:"ID"}),(0,n.jsx)(h.II,{size:"xs",disabled:!0,value:m.id})]}):(0,n.jsxs)(c.xu,{mb:"10px",children:[(0,n.jsx)($,{children:"UID"}),(0,n.jsx)(h.II,{size:"xs",disabled:!0,value:m.uid})]}),(0,n.jsxs)(c.xu,{mb:"10px",children:[(0,n.jsx)($,{children:"Criado em:"}),(0,n.jsx)(h.II,{size:"xs",disabled:!0,value:(0,E.Z)(m.createdAt)})]}),(0,n.jsxs)(c.xu,{mb:"10px",children:[(0,n.jsx)($,{children:"Email"}),(0,n.jsx)(h.II,{disabled:!0,value:m.email,onChange:e=>f({...m,email:e.target.value})})]}),(0,n.jsxs)(c.xu,{mb:"10px",p:"10px",bg:"gray.100",children:[(0,n.jsx)($,{children:"Imagem do Perfil"}),(0,n.jsx)(G,{ButtonComponent:(0,n.jsx)(c.xu,{color:"gray.600",children:(0,n.jsx)(C.JO,{h:"50px",w:"50px",borderRadius:"50%",p:"12px",as:W(),bg:"gray.400"})}),RenderComponent:(0,n.jsx)(w.Ee,{style:{borderRadius:"50%"},objectFit:"cover",width:"65px",height:"65px",src:(null==m?void 0:m.imgPerfilArr)&&(null==m?void 0:null===(t=m.imgPerfilArr[0])||void 0===t?void 0:t.url),alt:"imagem de perfil"}),Data:m,setData:f,updateItem:e=>(0,k.$G)({id:e.uid,...e},"users/",F,R),createItem:e=>(0,k.fC)({id:e.uid,...e},"users/",F,R),dbArrItem:"imgPerfilArr",dbPath:"users/",imgW:300,imgH:300,multiple:!1,maxImgs:1,storagePath:"users/".concat(null==m?void 0:m.uid,"/"),isCreating:!0,doing:g,setDoing:b})]}),((null===(r=m.tipo)||void 0===r?void 0:r.includes("corretor"))||!m.tipo&&"corretor"===m.role)&&(0,n.jsxs)(c.xu,{mb:"10px",p:"10px",bg:"gray.100",children:[(0,n.jsx)($,{children:"Imagem de Capa (Cover)"}),(0,n.jsx)(G,{ButtonComponent:(0,n.jsx)(c.xu,{color:"gray.600",children:(0,n.jsx)(C.JO,{h:"50px",w:"50px",borderRadius:"4px",p:"12px",as:W(),bg:"gray.400"})}),RenderComponent:(0,n.jsx)(w.Ee,{style:{borderRadius:"4px"},objectFit:"cover",width:"100%",height:"200px",src:(null==m?void 0:m.coverImgArr)&&(null==m?void 0:null===(a=m.coverImgArr[0])||void 0===a?void 0:a.url),alt:"imagem de capa",fallbackSrc:"https://firebasestorage.googleapis.com/v0/b/morando-em-barao.appspot.com/o/siteestrutura%2FfallbackImg.jpg?alt=media&token=cb24cde6-6285-4115-adef-911b60b062ea"}),Data:m,setData:f,updateItem:e=>(0,k.$G)({id:e.uid,...e},"users/",F,R),createItem:e=>(0,k.fC)({id:e.uid,...e},"users/",F,R),dbArrItem:"coverImgArr",dbPath:"users/",imgW:1200,imgH:400,multiple:!1,maxImgs:1,storagePath:"users/".concat(null==m?void 0:m.uid,"/cover/"),isCreating:!0,doing:g,setDoing:b})]}),(0,n.jsxs)(c.xu,{mb:"10px",children:[(0,n.jsx)($,{children:"N\xedvel de Acesso"}),(0,n.jsxs)(I.Ph,{value:m.role,onChange:e=>f({...m,role:e.target.value}),children:[(0,n.jsx)("option",{value:"",children:"Selecionar"}),(0,n.jsx)("option",{value:"corretor",children:"Corretor"})]})]}),(0,n.jsx)(c.xu,{children:(0,n.jsxs)(c.xu,{mb:"10px",children:[(0,n.jsx)($,{children:"Creci"}),(0,n.jsx)(h.II,{value:m.creci,onChange:e=>f({...m,creci:e.target.value})})]})}
1),(0,n.jsxs)(c.kC,{gridGap:"10px",children:[(0,n.jsxs)(c.xu,{mb:"10px",children:[(0,n.jsx)($,{children:"Nome"}),(0,n.jsx)(h.II,{value:m.nome,onChange:e=>f({...m,nome:e.target.value})})]}),(0,n.jsxs)(c.xu,{mb:"10px",children:[(0,n.jsx)($,{children:"Sobrenome"}),(0,n.jsx)(h.II,{value:m.sobrenome,onChange:e=>f({...m,sobrenome:e.target.value})})]})]}),((null===(o=m.tipo)||void 0===o?void 0:o.includes("corretor"))||!m.tipo&&"corretor"===m.role)&&(0,n.jsxs)(c.xu,{children:[(0,n.jsx)(_,{Data:m,setData:f,isEditingUsername:P,setIsEditingUsername:T}),!P&&(0,n.jsx)(A(),{href:"https://morandoembarao.com/corretor/".concat(m.username),children:(0,n.jsx)(c.xu,{cursor:"pointer",mt:"-5px",mb:"10px",fontSize:"13px",color:"blue.400",children:"https://morandoembarao.com/corretor/".concat(m.username)})})]}),(0,n.jsxs)(c.kC,{gridGap:"5px",children:[(0,n.jsxs)(c.xu,{mb:"10px",children:[(0,n.jsx)($,{children:"Telefone"}),(0,n.jsx)(H.Z,{format:"## #####-####",_disabled:{bg:"gray.100",border:"0px"},customInput:h.II,size:"sm",bg:"white",placeholder:"N\xe3o preenchido",value:m.tel,onChange:e=>f({...m,tel:e.target.value})})]}),(0,n.jsxs)(c.xu,{mb:"10px",children:[(0,n.jsx)($,{children:"Whatsapp"}),(0,n.jsx)(H.Z,{format:"## #####-####",_disabled:{bg:"gray.100",border:"0px"},customInput:h.II,size:"sm",bg:"white",placeholder:"N\xe3o preenchido",value:m.whatsapp,onChange:e=>f({...m,whatsapp:e.target.value})})]})]}),(0,n.jsxs)(c.xu,{mb:"50px",children:[(0,n.jsx)($,{children:"Sobre mim"}),(0,n.jsx)(z.g,{value:m.sobremim,onChange:e=>f({...m,sobremim:e.target.value})})]})]})})}),(0,n.jsx)(y.mz,{justifyContent:"space-between",children:(0,n.jsxs)(c.kC,{children:[!x&&(0,n.jsx)(S.zx,{isDisabled:g||P,onClick:()=>{(0,k.$G)({id:m.uid,...m},"users",O,R),b(!0)},mr:"5px",children:"Atualizar"}),(0,n.jsx)(S.zx,{isDisabled:g,onClick:()=>u(),children:"Fechar"})]})})]})]})};let X=a.ZP.div.withConfig({componentId:"sc-3ef8994e-0"})(["display:flex;justify-content:space-between;padding:20px;"]),Y=a.ZP.div.withConfig({componentId:"sc-3ef8994e-1"})(["font-size:16px;text-transform:uppercase;color:",";font-weight:500;margin-bottom:10px;"],e=>e.theme.colors.grey7),ee=a.ZP.div.withConfig({componentId:"sc-3ef8994e-2"})(["display:grid;grid-gap:10px;grid-template-columns:1fr 1fr;grid-template-rows:auto;grid-auto-rows:auto;padding:10px;"]),et=a.ZP.div.withConfig({componentId:"sc-3ef8994e-3"})(["width:100%;cursor:pointer;background:",";padding:10px 10px 15px 10px;"],e=>e.theme.colors.grey1);var er=()=>{let[e,t]=(0,i.useState)([]),[r,a]=(0,i.useState)([]),[h,x]=(0,i.useState)({}),[p,m]=(0,i.useState)(!1),[f,g]=(0,i.useState)(!1),v=(0,i.useContext)(o.Y);(0,i.useEffect)(()=>{v.setDash(!0)},[]),(0,i.useEffect)(()=>{let e=(0,l.hJ)(u.db,"users"),r=(0,l.IO)(e,(0,l.ar)("role","==","corretor")),n=(0,l.cf)(r,e=>{let r=[];e.forEach(e=>{r.push(e.data())}),t(r)});return()=>n()},[]);let j=e=>{let{score:t,...r}=e;x({id:r.uid,...r})};return(0,n.jsxs)(s.Z,{children:[(0,n.jsx)(X,{children:(0,n.jsx)(Y,{children:"Corretores"})}),(0,n.jsxs)(c.kC,{alignItems:"flex-end",mb:"10px",children:[(0,n.jsx)(c.xu,{pl:"10px",mr:"10px",children:(0,n.jsx)(b,{items:e,keys:["nome","email"],results:r,setResults:a})}),(0,n.jsx)(c.xu,{children:"Para inserir corretores: Painel - Usu\xe1rios"})]}),(0,n.jsxs)(d.mQ,{children:[(0,n.jsx)(d.td,{}),(0,n.jsx)(d.nP,{children:(0,n.jsxs)(d.x4,{children:[(0,n.jsxs)(c.xu,{children:[null==e?void 0:e.length," corretores"]}),(0,n.jsx)(ee,{children:r.sort((e,t)=>t.createdAt-e.createdAt).map(e=>(0,n.jsx)(et,{onClick:()=>j(e),children:(0,n.jsxs)(c.xu,{children:[(0,n.jsxs)(c.kC,{cursor:"pointer",fontWeight:"500",children:[(0,n.jsx)(c.xu,{mr:"5px",fontSize:"14px",children:e.nome}),(0,n.jsx)(c.xu,{fontSize:"14px",children:e.sobrenome})]}),(0,n.jsx)(c.xu,{mr:"5px",fontSize:"14px",children:e.email}),(0,n.jsxs)(c.rj,{templateColumns:"1fr 1fr",children:[(0,n.jsx)(c.xu,{fontSize:"11px",children:e.uid||e.id}),e.createdAt&&(0,n.jsx)(c.xu,{fontSize:"13px",children:(0,E.Z)(e.createdAt)}),e.role&&(0,n.jsx)(c.kC,{children:(0,n.jsx)(c.xu,{color:"white",px:"4px",fontWeight:"bold",fontSize:"13px",bg:"purple.500",children:e.role})})]})]})},e.id))})]})})]}),(0,n.jsx)(Q,{modalOpen:p,itemData:h,isCreating:f,setIsCreating:g,closeModal:()=>{m(!1),x({}),g(!1)},setModalOpen:m})]})}},76770:function(e){(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}
1),Object.defineProperty(e,"__esModule",{value:!0})}},r={};t.r(r),t.d(r,{default:()=>i});var n=function(){var e;function t(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t)}return e=[{key:"changeHeightWidth",value:function(e,t,r,n,i,a){return r>n&&(e=Math.round(e*n/r),r=n),e>t&&(r=Math.round(r*t/e),e=t),i&&r<i&&(e=Math.round(e*i/r),r=i),a&&e<a&&(r=Math.round(r*a/e),e=a),{height:e,width:r}}},{key:"resizeAndRotateImage",value:function(e,t,r,n,i){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"jpeg",o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:100,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,l=document.createElement("canvas"),c=e.width,d=e.height,u=this.changeHeightWidth(d,r,c,t,n,i);s&&(90===s||270===s)?(l.width=u.height,l.height=u.width):(l.width=u.width,l.height=u.height),c=u.width,d=u.height;var h=l.getContext("2d");return h.fillStyle="rgba(0, 0, 0, 0)",h.fillRect(0,0,c,d),h.imageSmoothingEnabled&&h.imageSmoothingQuality&&(h.imageSmoothingQuality="high"),s&&(h.rotate(s*Math.PI/180),90===s?h.translate(0,-l.width):180===s?h.translate(-l.width,-l.height):270===s?h.translate(-l.height,0):0!==s&&360!==s||h.translate(0,0)),h.drawImage(e,0,0,c,d),l.toDataURL("image/".concat(a),o/100)}},{key:"b64toByteArrays",value:function(e,t){t=t||"image/jpeg";for(var r=atob(e.toString().replace(/^data:image\/(png|jpeg|jpg|webp);base64,/,"")),n=[],i=0;i<r.length;i+=512){for(var a=r.slice(i,i+512),o=Array(a.length),s=0;s<a.length;s++)o[s]=a.charCodeAt(s);var l=new Uint8Array(o);n.push(l)}return n}},{key:"b64toBlob",value:function(e,t){return new Blob(this.b64toByteArrays(e,t),{type:t,lastModified:new Date})}},{key:"b64toFile",value:function(e,t,r){return new File(this.b64toByteArrays(e,r),t,{type:r,lastModified:new Date})}},{key:"createResizedImage",value:function(e,r,n,i,a,o,s){var l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"base64",c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null,d=arguments.length>9&&void 0!==arguments[9]?arguments[9]:null,u=new FileReader;if(!e)throw Error("File Not Found!");if(e.type&&!e.type.includes("image"))throw Error("File Is NOT Image!");u.readAsDataURL(e),u.onload=function(){var h=new Image;h.src=u.result,h.onload=function(){var u=t.resizeAndRotateImage(h,r,n,c,d,i,a,o),x="image/".concat(i);switch(l){case"blob":s(t.b64toBlob(u,x));break;case"base64":default:s(u);break;case"file":var p=e.name.toString().replace(/(png|jpeg|jpg|webp)$/i,"").concat(i.toString());s(t.b64toFile(u,p,x))}}},u.onerror=function(e){throw Error(e)}}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t,e),t}();let i={imageFileResizer:function(e,t,r,i,a,o,s,l,c,d){return n.createResizedImage(e,t,r,i,a,o,s,l,c,d)}};e.exports=r})()},9557:function(){},56845:function(e,t,r){"use strict";r.d(t,{B0:function(){return n.B0},Jt:function(){return n.Jt},aF:function(){return n.aF},cF:function(){return n.cF},iH:function(){return n.iH},oq:function(){return n.oq},sf:function(){return n.sf}});var n=r(90774)},53416:function(e,t,r){"use strict";r.d(t,{x0:function(){return n}});let n=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((e,t)=>((t&=63)<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),"")}},function(e){e.O(0,[6911,4612,9956,6984,7333,8764,6261,5713,3270,653,7732,7561,9822,2075,1665,9983,2888,9774,179],function(){return e(e.s=44658)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.