vendor: 3,745 bytes, lines 1-11
1import{c as z,r as i,j as e,ak as we,ai as Ce,ad as Y,as as Ne,af as C,ag as j,ae as q,ac as Ie,ah as Te,am as M,H as Fe,A as Se,m as Re,J as Ee,at as Ae,L as U,au as _e,av as Pe,K as ke,$ as V,Q as B,aw as I,ax as Le}from"./index-A3FuQDYt.js";import{I as T}from"./input-D10gJ_aP.js";import{L as F}from"./label-CUWd_8FN.js";import{u as J}from"./index-D6QrhzOr.js";import{u as De}from"./useAdminAuth-Clekj91V.js";import{L as _}from"./lock-6I0WuY7i.js";import{L as H}from"./loader-circle-CBfn6mAQ.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const Me=z("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/** 7 * @license lucide-react v0.462.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const Ke=z("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);function Ge(t,s=[]){let a=[];function o(m,r){const c=i.createContext(r),f=a.length;a=[...a,r];function u(d){const{scope:p,children:x,...n}=d,h=(p==null?void 0:p[t][f])||c,N=i.useMemo(()=>n,Object.values(n));return e.jsx(h.Provider,{value:N,children:x})}function v(d,p){const x=(p==null?void 0:p[t][f])||c,n=i.useContext(x);if(n)return n;if(r!==void 0)return r;throw new Error(`\`${d}\` must be used within \`${m}\``)}return u.displayName=m+"Provider",[u,v]}const l=()=>{const m=a.map(r=>i.createContext(r));return function(c){const f=(c==null?void 0:c[t])||m;return i.useMemo(()=>({[`__scope${t}`]:{...c,[t]:f}}),[c,f])}};return l.scopeName=t,[o,Oe(l,...s)]}function Oe(...t){const s=t[0];if(t.length===1)return s;const a=()=>{const o=t.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(m){const r=o.reduce((c,{useScope:f,scopeName:u})=>{const d=f(m)[`__scope${u}`];return{...c,...d}},{});return i.useMemo(()=>({[`__scope${s.scopeName}`]:r}),[r])}};return a.scopeName=s.scopeName,a}var P="rovingFocusGroup.onEntryFocus",$e={bubbles:!1,cancelable:!0},S="RovingFocusGroup",[k,Q,Ue]=we(S),[Ve,W]=Ge(S,[Ue]),[Be,He]=Ve(S),X=i.forwardRef((t,s)=>e.jsx(k.Provider,{scope:t.__scopeRovingFocusGroup,children:e.jsx(k.Slot,{scope:t.__scopeRovingFocusGroup,children:e.jsx(ze,{...t,ref:s})})}));X.displayName=S;var ze=i.forwardRef((t,s)=>{const{__scopeRovingFocusGroup:a,orientation:o,loop:l=!1,dir:m,currentTabStopId:r,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:f,onEntryFocus:u,preventScrollOnEntryFocus:v=!1,...d}=t,p=i.useRef(null),x=Ce(s,p),n=J(m),[h=null,N]=Y({prop:r,defaultProp:c,onChange:f}),[b,y]=i.useState(!1),R=Ne(u),xe=Q(a),E=i.useRef(!1),[ge,O]=i.useState(0);return i.useEffect(()=>{const g=p.current;if(g)return g.addEventListener(P,R),()=>g.removeEventListener(P,R)},[R]),e.jsx(Be,{scope:a,orientation:o,dir:n,loop:l,currentTabStopId:h,onItemFocus:i.useCallback(g=>N(g),[N]),onItemShiftTab:i.useCallback(()=>y(!0),[]),onFocusableItemAdd:i.useCallback(()=>O(g=>g+1),[]),onFocusableItemRemove:i.useCallback(()=>O(g=>g-1),[]),children:e.jsx(C.div,{tabIndex:b||ge===0?-1:0,"data-orientation":o,...d,ref:x,style:{outline:"none",...t.style},onMouseDown:j(t.onMouseDown,()=>{E.current=!0}),onFocus:j(t.onFocus,g=>{const he=!E.current;if(g.target===g.currentTarget&&he&&!b){const $=new CustomEvent(P,$e);if(g.currentTarget.dispatchEvent($),!$.defaultPrevented){const A=xe().filter(w=>w.focusable),be=A.find(w=>w.active),ye=A.find(w=>
vendor: 4,999 bytes, line 11
11w.id===h),je=[be,ye,...A].filter(Boolean).map(w=>w.ref.current);te(je,v)}}E.current=!1}),onBlur:j(t.onBlur,()=>y(!1))})})}),Z="RovingFocusGroupItem",ee=i.forwardRef((t,s)=>{const{__scopeRovingFocusGroup:a,focusable:o=!0,active:l=!1,tabStopId:m,...r}=t,c=q(),f=m||c,u=He(Z,a),v=u.currentTabStopId===f,d=Q(a),{onFocusableItemAdd:p,onFocusableItemRemove:x}=u;return i.useEffect(()=>{if(o)return p(),()=>x()},[o,p,x]),e.jsx(k.ItemSlot,{scope:a,id:f,focusable:o,active:l,children:e.jsx(C.span,{tabIndex:v?0:-1,"data-orientation":u.orientation,...r,ref:s,onMouseDown:j(t.onMouseDown,n=>{o?u.onItemFocus(f):n.preventDefault()}),onFocus:j(t.onFocus,()=>u.onItemFocus(f)),onKeyDown:j(t.onKeyDown,n=>{if(n.key==="Tab"&&n.shiftKey){u.onItemShiftTab();return}if(n.target!==n.currentTarget)return;const h=Je(n,u.orientation,u.dir);if(h!==void 0){if(n.metaKey||n.ctrlKey||n.altKey||n.shiftKey)return;n.preventDefault();let b=d().filter(y=>y.focusable).map(y=>y.ref.current);if(h==="last")b.reverse();else if(h==="prev"||h==="next"){h==="prev"&&b.reverse();const y=b.indexOf(n.currentTarget);b=u.loop?Qe(b,y+1):b.slice(y+1)}setTimeout(()=>te(b))}})})})});ee.displayName=Z;var Ye={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function qe(t,s){return s!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Je(t,s,a){const o=qe(t.key,a);if(!(s==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(s==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return Ye[o]}function te(t,s=!1){const a=document.activeElement;for(const o of t)if(o===a||(o.focus({preventScroll:s}),document.activeElement!==a))return}function Qe(t,s){return t.map((a,o)=>t[(s+o)%t.length])}var We=X,Xe=ee,K="Tabs",[Ze,dt]=Ie(K,[W]),ae=W(),[et,G]=Ze(K),se=i.forwardRef((t,s)=>{const{__scopeTabs:a,value:o,onValueChange:l,defaultValue:m,orientation:r="horizontal",dir:c,activationMode:f="automatic",...u}=t,v=J(c),[d,p]=Y({prop:o,onChange:l,defaultProp:m});return e.jsx(et,{scope:a,baseId:q(),value:d,onValueChange:p,orientation:r,dir:v,activationMode:f,children:e.jsx(C.div,{dir:v,"data-orientation":r,...u,ref:s})})});se.displayName=K;var oe="TabsList",ne=i.forwardRef((t,s)=>{const{__scopeTabs:a,loop:o=!0,...l}=t,m=G(oe,a),r=ae(a);return e.jsx(We,{asChild:!0,...r,orientation:m.orientation,dir:m.dir,loop:o,children:e.jsx(C.div,{role:"tablist","aria-orientation":m.orientation,...l,ref:s})})});ne.displayName=oe;var re="TabsTrigger",ie=i.forwardRef((t,s)=>{const{__scopeTabs:a,value:o,disabled:l=!1,...m}=t,r=G(re,a),c=ae(a),f=ue(r.baseId,o),u=de(r.baseId,o),v=o===r.value;return e.jsx(Xe,{asChild:!0,...c,focusable:!l,active:v,children:e.jsx(C.button,{type:"button",role:"tab","aria-selected":v,"aria-controls":u,"data-state":v?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:f,...m,ref:s,onMouseDown:j(t.onMouseDown,d=>{!l&&d.button===0&&d.ctrlKey===!1?r.onValueChange(o):d.preventDefault()}),onKeyDown:j(t.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&r.onValueChange(o)}),onFocus:j(t.onFocus,()=>{const d=r.activationMode!=="manual";!v&&!l&&d&&r.onValueChange(o)})})})});ie.displayName=re;var ce="TabsContent",le=i.forwardRef((t,s)=>{const{__scopeTabs:a,value:o,forceMount:l,children:m,...r}=t,c=G(ce,a),f=ue(c.baseId,o),u=de(c.baseId,o),v=o===c.value,d=i.useRef(v);return i.useEffect(()=>{const p=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(p)},[]),e.jsx(Te,{present:l||v,children:({present:p})=>e.jsx(C.div,{"data-state":v?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":f,hidden:!p,id:u,tabIndex:0,...r,ref:s,style:{...t.style,animationDuration:d.current?"0s":void 0},children:p&&m})})});le.displayName=ce;function ue(t,s){return`${t}-trigger-${s}`}function de(t,s){return`${t}-content-${s}`}var tt=se,me=ne,fe=ie,pe=le;const at=tt,ve=i.forwardRef(({className:t,...s},a)=>e.jsx(me,{ref:a,className:M("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",t),...s}));ve.displayName=me.displayName;const L=i.forwardRef(({className:t,...s},a)=>e.jsx(fe,{ref:a,className:M("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",t),...s}));L.displayName=fe.displayName;const D=i.forwardRef(({className:t,...s},a)=>e.jsx(pe,{ref:a,className:M("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...s}));D.displayName=pe.displayName;function mt(){const[t,s]=i.useState(""),[a,o]=i.useState(""),[l,m]=i.useState(""),[r,c]=i.useState(!1),[f,u]=i.useState("login"),{login:v}=De({autoCheck:!1}),d=async()=>
11{if(!(!t||!a)){c(!0);try{await v(t,a)}catch{}finally{c(!1)}}},p=async()=>{if(!(!t||!a||!l)){if(a!==l){I.error("As senhas não coincidem");return}if(a.length<6){I.error("A senha deve ter pelo menos 6 caracteres");return}c(!0);try{const{error:n}=await Le.auth.signUp({email:t,password:a,options:{emailRedirectTo:window.location.origin+"/admin"}});if(n){I.error(n.message);return}I.success("Conta criada com sucesso! Faça login para continuar."),u("login"),o(""),m("")}catch{I.error("Erro ao criar conta")}finally{c(!1)}}},x=n=>{n.key==="Enter"&&!r&&(f==="login"?d():p())};return e.jsxs(e.Fragment,{children:[e.jsxs(Fe,{children:[e.jsx("title",{children:"Login Admin | Orne.ai"}),e.jsx("meta",{name:"description",content:"Acesso restrito ao painel administrativo da Orne.ai."}),e.jsx("meta",{name:"robots",content:"noindex,nofollow"})]}),e.jsxs("div",{className:"min-h-screen relative flex items-center justify-center",children:[e.jsx(Se,{}),e.jsx(Re.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"relative z-10 w-full max-w-md px-4",children:e.jsxs(Ee,{className:"bg-card/50 backdrop-blur-md border-border/50",children:[e.jsxs(Ae,{className:"text-center",children:[e.jsx(U,{to:"/",className:"inline-block mx-auto mb-4",children:e.jsx("img",{src:"/lovable-uploads/aade421c-b54b-498c-9b6a-b2dc102b205c.png",alt:"Orne.ai",className:"h-12 w-auto"})}),e.jsx(_e,{className:"text-2xl",children:"Painel Administrativo"}),e.jsx(Pe,{children:"Acesse ou crie sua conta para gerenciar o blog"})]}),e.jsxs(ke,{children:[e.jsxs(at,{value:f,onValueChange:u,children:[e.jsxs(ve,{className:"grid w-full grid-cols-2 mb-6",children:[e.jsxs(L,{value:"login",className:"gap-2",children:[e.jsx(Me,{className:"w-4 h-4"}),"Login"]}),e.jsxs(L,{value:"signup",className:"gap-2",children:[e.jsx(Ke,{className:"w-4 h-4"}),"Cadastro"]})]}),e.jsx(D,{value:"login",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(F,{htmlFor:"login-email",children:"Email"}),e.jsxs("div",{className:"relative",children:[e.jsx(V,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(T,{id:"login-email",type:"email",value:t,onChange:n=>s(n.target.value),onKeyDown:x,placeholder:"[email protected]",className:"pl-10"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(F,{htmlFor:"login-password",children:"Senha"}),e.jsxs("div",{className:"relative",children:[e.jsx(_,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(T,{id:"login-password",type:"password",value:a,onChange:n=>o(n.target.value),onKeyDown:x,placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",className:"pl-10"})]})]}),e.jsx(B,{type:"button",className:"w-full",disabled:r||!t||!a,onClick:d,children:r?e.jsxs(e.Fragment,{children:[e.jsx(H,{className:"w-4 h-4 animate-spin mr-2"}),"Entrando..."]}):"Entrar"})]})}),e.jsx(D,{value:"signup",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(F,{htmlFor:"signup-email",children:"Email"}),e.jsxs("div",{className:"relative",children:[e.jsx(V,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(T,{id:"signup-email",type:"email",value:t,onChange:n=>s(n.target.value),onKeyDown:x,placeholder:"[email protected]",className:"pl-10"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(F,{htmlFor:"signup-password",children:"Senha"}),e.jsxs("div",{className:"relative",children:[e.jsx(_,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(T,{id:"signup-password",type:"password",value:a,onChange:n=>o(n.target.value),onKeyDown:x,placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",className:"pl-10"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(F,{htmlFor:"confirm-password",children:"Confirmar Senha"}),e.jsxs("div",{className:"relative",children:[e.jsx(_,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(T,{id:"confirm-password",type:"password",value:l,onChange:n=>m(n.target.value),onKeyDown:x,placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",className:"pl-10"})]})]}
11),e.jsx(B,{type:"button",className:"w-full",disabled:r||!t||!a||!l,onClick:p,children:r?e.jsxs(e.Fragment,{children:[e.jsx(H,{className:"w-4 h-4 animate-spin mr-2"}),"Criando conta..."]}):"Criar Conta"}),e.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Nota: Após criar a conta, um administrador precisa atribuir a role de admin para acesso completo."})]})})]}),e.jsx("div",{className:"mt-6 text-center",children:e.jsx(U,{to:"/",className:"text-sm text-muted-foreground hover:text-primary transition-colors",children:"Voltar para o site"})})]})]})})]})]})}export{mt as default};
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.