First commit - backup RDOC

This commit is contained in:
2026-02-20 07:20:32 -03:00
commit b7415f0586
259 changed files with 51707 additions and 0 deletions

1
dist/assets/css/index-DXaaJsOA.css vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/assets/js/Auth-KZISTjMo.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
import{j as e}from"./query-vendor-BLVqILA6.js";import{d as w,r as t}from"./router-vendor-D4by-_6Z.js";import{s as i}from"./index-doec96Hx.js";import{a0 as j,c as b,a2 as N}from"./ui-vendor-CyRvbSfR.js";import"./react-vendor-CqRd3GwO.js";import"./supabase-vendor-CnnNSQLo.js";import"./state-vendor-DHadhBU5.js";const _=()=>{const o=w(),[s,c]=t.useState("loading"),[g,n]=t.useState("Processando autenticação..."),l=t.useCallback(async()=>{try{const a=new URLSearchParams(window.location.search),d=a.get("error"),x=a.get("error_description");if(d)throw new Error(x||d);const{data:{session:r},error:m}=await i.auth.getSession();if(m)throw m;if(!r)throw new Error("Nenhuma sessão encontrada");const{data:u,error:h}=await i.from("usuarios").select("id, organizacao_id").eq("id",r.user.id).single();if(!u&&h?.code==="PGRST116"){const{error:p}=await i.from("usuarios").insert({id:r.user.id,email:r.user.email,nome:r.user.user_metadata.full_name||r.user.email?.split("@")[0]})}c("success"),n("Login realizado com sucesso!");const f=u?.organizacao_id;setTimeout(()=>{o(f?"/":"/selecionar-organizacao")},1e3)}catch(a){c("error"),n(a instanceof Error?a.message:"Erro ao processar autenticação"),setTimeout(()=>{o("/login")},3e3)}},[o]);return t.useEffect(()=>{l()},[l]),e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 to-indigo-100 flex items-center justify-center p-4",children:e.jsx("div",{className:"bg-white rounded-2xl shadow-xl p-8 max-w-md w-full",children:e.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[s==="loading"&&e.jsx(j,{className:"w-16 h-16 text-blue-500 animate-spin"}),s==="success"&&e.jsx(b,{className:"w-16 h-16 text-green-500"}),s==="error"&&e.jsx(N,{className:"w-16 h-16 text-red-500"}),e.jsxs("div",{className:"text-center",children:[e.jsxs("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:[s==="loading"&&"Processando...",s==="success"&&"Sucesso!",s==="error"&&"Erro"]}),e.jsx("p",{className:"text-gray-600",children:g})]}),s==="loading"&&e.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2 overflow-hidden",children:e.jsx("div",{className:"bg-blue-500 h-2 rounded-full animate-pulse w-2/3"})}),s!=="loading"&&e.jsx("p",{className:"text-sm text-gray-500",children:s==="success"?"Redirecionando para o sistema...":"Redirecionando para o login..."})]})})})};export{_ as AuthCallback};

1
dist/assets/js/Cadastros-QZZ_REjv.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
dist/assets/js/CreateObra-BwwQt_hK.js vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/assets/js/CreateRDO-Bhe5_7xI.js vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/assets/js/CreateTask-BlEDuvPM.js vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/assets/js/Dashboard-BPPxBqO4.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
import{j as M}from"./query-vendor-BLVqILA6.js";import{r as c}from"./router-vendor-D4by-_6Z.js";const E=()=>{const l=c.useRef(null),h=c.useRef(),n=c.useRef([]);return c.useEffect(()=>{const e=l.current;if(!e)return;const r=e.getContext("2d");if(!r)return;const f=()=>{e.width=window.innerWidth,e.height=window.innerHeight},u=()=>{const t=Math.floor(e.width*e.height/15e3);n.current=[];for(let a=0;a<t;a++)n.current.push({x:Math.random()*e.width,y:Math.random()*e.height,vx:(Math.random()-.5)*.5,vy:(Math.random()-.5)*.5})},g=t=>{r.beginPath(),r.arc(t.x,t.y,2,0,Math.PI*2),r.fillStyle="rgba(147, 197, 253, 0.8)",r.fill()},y=(t,a,i,o)=>{const s=1-i/o;r.beginPath(),r.moveTo(t.x,t.y),r.lineTo(a.x,a.y),r.strokeStyle=`rgba(147, 197, 253, ${s*.3})`,r.lineWidth=1,r.stroke()},v=()=>{n.current.forEach(t=>{t.x+=t.vx,t.y+=t.vy,(t.x<0||t.x>e.width)&&(t.vx*=-1),(t.y<0||t.y>e.height)&&(t.vy*=-1),t.x=Math.max(0,Math.min(e.width,t.x)),t.y=Math.max(0,Math.min(e.height,t.y))})},x=()=>{r.clearRect(0,0,e.width,e.height);const t=r.createLinearGradient(0,0,e.width,e.height);t.addColorStop(0,"#0f172a"),t.addColorStop(.5,"#1e1b4b"),t.addColorStop(1,"#581c87"),r.fillStyle=t,r.fillRect(0,0,e.width,e.height),v();const a=120;for(let i=0;i<n.current.length;i++)for(let o=i+1;o<n.current.length;o++){const s=n.current[i],d=n.current[o],w=Math.sqrt(Math.pow(s.x-d.x,2)+Math.pow(s.y-d.y,2));w<a&&y(s,d,w,a)}n.current.forEach(g),h.current=requestAnimationFrame(x)};f(),u(),x();const m=()=>{f(),u()};return window.addEventListener("resize",m),()=>{window.removeEventListener("resize",m),h.current&&cancelAnimationFrame(h.current)}},[]),M.jsx("canvas",{ref:l,className:"fixed inset-0 w-full h-full -z-10",style:{background:"linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #581c87 100%)"}})};export{E as N};

File diff suppressed because one or more lines are too long

1
dist/assets/js/ObraTasks-Cy-rxhIo.js vendored Normal file

File diff suppressed because one or more lines are too long

5
dist/assets/js/RDODetails-tkR9ftO-.js vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/assets/js/Reports-BmqmPZPj.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
import{j as a}from"./query-vendor-BLVqILA6.js";import{r as o}from"./router-vendor-D4by-_6Z.js";import{m as s,I as l,am as i}from"./ui-vendor-CyRvbSfR.js";function n(){const[t,e]=o.useState(()=>{const r=localStorage.getItem("theme");return r||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")});return o.useEffect(()=>{document.documentElement.classList.remove("light","dark"),document.documentElement.classList.add(t),localStorage.setItem("theme",t)},[t]),{theme:t,toggleTheme:()=>{e(r=>r==="light"?"dark":"light")},isDark:t==="dark"}}function h(){const{toggleTheme:t,isDark:e}=n();return a.jsx(s.button,{onClick:t,className:"relative p-2 rounded-xl bg-white/70 dark:bg-gray-800/70 backdrop-blur-md border border-gray-200/50 dark:border-gray-700/50 shadow-lg hover:shadow-xl transition-all duration-300 group",whileHover:{scale:1.05},whileTap:{scale:.95},title:e?"Alternar para modo claro":"Alternar para modo escuro",children:a.jsxs("div",{className:"relative w-6 h-6",children:[a.jsx(s.div,{initial:!1,animate:{scale:e?0:1,rotate:e?180:0,opacity:e?0:1},transition:{duration:.3,ease:"easeInOut"},className:"absolute inset-0 flex items-center justify-center",children:a.jsx(l,{className:"w-5 h-5 text-yellow-500 group-hover:text-yellow-600"})}),a.jsx(s.div,{initial:!1,animate:{scale:e?1:0,rotate:e?0:-180,opacity:e?1:0},transition:{duration:.3,ease:"easeInOut"},className:"absolute inset-0 flex items-center justify-center",children:a.jsx(i,{className:"w-5 h-5 text-blue-400 group-hover:text-blue-300"})})]})})}export{h as T};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

3
dist/assets/js/index-doec96Hx.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

32
dist/assets/js/react-vendor-CqRd3GwO.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

424
dist/assets/js/ui-vendor-CyRvbSfR.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,12 @@
import{r as d}from"./router-vendor-D4by-_6Z.js";import{s as n}from"./index-doec96Hx.js";const w=()=>{const[g,s]=d.useState(!1),[m,t]=d.useState(null);return{loading:g,error:m,validarConvite:async i=>{try{s(!0),t(null);const e=i.toUpperCase().trim(),{data:r,error:a}=await n.from("convites").select(`
id,
codigo,
organizacao_id,
role,
max_usos,
usos_atuais,
ativo,
expira_em,
email_convidado,
organizacoes:organizacao_id (nome)
`).eq("codigo",e).eq("ativo",!0).single();if(a||!r)return{success:!1,error:"Código de convite inválido ou expirado."};const o=r;return o.expira_em&&new Date(o.expira_em)<new Date?{success:!1,error:"Este código de convite expirou."}:o.max_usos>0&&o.usos_atuais>=o.max_usos?{success:!1,error:"Este código de convite já atingiu o limite de usos."}:{success:!0,organizacao_id:o.organizacao_id,organizacao_nome:o.organizacoes?.nome||"Organização",role:o.role}}catch(e){const r=e instanceof Error?e.message:"Erro ao validar convite";return t(r),{success:!1,error:r}}finally{s(!1)}},usarConvite:async(i,e)=>{try{s(!0),t(null);const{data:r,error:a}=await n.rpc("usar_convite",{p_codigo:i,p_usuario_id:e});if(a)throw a;const o=r;return o.success||t(o.error||"Erro ao usar convite"),o}catch(r){const a=r instanceof Error?r.message:"Erro ao usar convite";return t(a),{success:!1,error:a}}finally{s(!1)}},gerarConvite:async(i,e={})=>{try{s(!0),t(null);const{data:r,error:a}=await n.rpc("gerar_codigo_convite");if(a)throw a;const o=r;let u=null;if(e.expiraEmDias){const c=new Date;c.setDate(c.getDate()+e.expiraEmDias),u=c.toISOString()}const{data:{user:f}}=await n.auth.getUser(),{error:l}=await n.from("convites").insert({organizacao_id:i,codigo:o,criado_por:f?.id,email_convidado:e.emailConvidado||null,role:e.role||"usuario",max_usos:e.maxUsos??1,expira_em:u});if(l)throw l;return{success:!0,codigo:o}}catch(r){const a=r instanceof Error?r.message:"Erro ao gerar convite";return t(a),{success:!1,error:a}}finally{s(!1)}},listarConvites:async i=>{try{s(!0);const{data:e,error:r}=await n.from("convites").select("*").eq("organizacao_id",i).order("created_at",{ascending:!1});if(r)throw r;return e||[]}catch{return[]}finally{s(!1)}}}};export{w as u};

View File

@@ -0,0 +1 @@
import{d,p as U,s as o}from"./index-doec96Hx.js";import{c as g}from"./state-vendor-DHadhBU5.js";import"./query-vendor-BLVqILA6.js";import"./router-vendor-D4by-_6Z.js";import"./react-vendor-CqRd3GwO.js";import"./ui-vendor-CyRvbSfR.js";import"./supabase-vendor-CnnNSQLo.js";const i={currentUser:null,users:[],loading:!1,error:null},m=g()(d(U((r,u)=>({...i,setCurrentUser:e=>r({currentUser:e},!1,"setCurrentUser"),setUsers:e=>r({users:e},!1,"setUsers"),setLoading:e=>r({loading:e},!1,"setLoading"),setError:e=>r({error:e},!1,"setError"),clearError:()=>r({error:null},!1,"clearError"),reset:()=>r(i,!1,"reset"),fetchCurrentUser:async e=>{try{r({loading:!0,error:null},!1,"fetchCurrentUser:start");const{data:s,error:a}=await o.from("usuarios").select("*").eq("id",e).single();if(a)throw a;r({currentUser:s,loading:!1},!1,"fetchCurrentUser:success")}catch(s){r({error:s.message||"Erro ao buscar usuário",loading:!1},!1,"fetchCurrentUser:error")}},fetchUsers:async()=>{try{r({loading:!0,error:null},!1,"fetchUsers:start");const{data:e,error:s}=await o.from("usuarios").select("*").order("nome");if(s)throw s;r({users:e||[],loading:!1},!1,"fetchUsers:success")}catch(e){r({error:e.message||"Erro ao buscar usuários",loading:!1},!1,"fetchUsers:error")}},updateUser:async(e,s)=>{try{r({loading:!0,error:null},!1,"updateUser:start");const{data:a,error:t}=await o.from("usuarios").update({...s,updated_at:new Date().toISOString()}).eq("id",e).select().single();if(t)throw t;const{users:n,currentUser:l}=u(),f=n.map(c=>c.id===e?a:c);return r({users:f,currentUser:l?.id===e?a:l,loading:!1},!1,"updateUser:success"),!0}catch(a){return r({error:a.message||"Erro ao atualizar usuário",loading:!1},!1,"updateUser:error"),!1}},createUser:async e=>{try{r({loading:!0,error:null},!1,"createUser:start");const{data:s,error:a}=await o.from("usuarios").insert(e).select().single();if(a)throw a;const{users:t}=u();return r({users:[...t,s],loading:!1},!1,"createUser:success"),!0}catch(s){return r({error:s.message||"Erro ao criar usuário",loading:!1},!1,"createUser:error"),!1}},deleteUser:async e=>{try{r({loading:!0,error:null},!1,"deleteUser:start");const{error:s}=await o.from("usuarios").delete().eq("id",e);if(s)throw s;const{users:a,currentUser:t}=u(),n=a.filter(l=>l.id!==e);return r({users:n,currentUser:t?.id===e?null:t,loading:!1},!1,"deleteUser:success"),!0}catch(s){return r({error:s.message||"Erro ao deletar usuário",loading:!1},!1,"deleteUser:error"),!1}}}),{name:"user-store",partialize:r=>({currentUser:r.currentUser,users:r.users})}))),b=()=>m(r=>r.currentUser);export{b as useCurrentUser,m as useUserStore};

1
dist/assets/js/zod-7IfHMaWP.js vendored Normal file
View File

@@ -0,0 +1 @@
import{a as p,b as y,c as v}from"./form-vendor-vQotxSmE.js";function g(r,s,o){function e(t,c){var u;Object.defineProperty(t,"_zod",{value:t._zod??{},enumerable:!1}),(u=t._zod).traits??(u.traits=new Set),t._zod.traits.add(r),s(t,c);for(const f in n.prototype)f in t||Object.defineProperty(t,f,{value:n.prototype[f].bind(t)});t._zod.constr=n,t._zod.def=c}const a=o?.Parent??Object;class i extends a{}Object.defineProperty(i,"name",{value:r});function n(t){var c;const u=o?.Parent?new i:this;e(u,t),(c=u._zod).deferred??(c.deferred=[]);for(const f of u._zod.deferred)f();return u}return Object.defineProperty(n,"init",{value:e}),Object.defineProperty(n,Symbol.hasInstance,{value:t=>o?.Parent&&t instanceof o.Parent?!0:t?._zod?.traits?.has(r)}),Object.defineProperty(n,"name",{value:r}),n}class j extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const z={};function m(r){return z}function w(r,s){return typeof s=="bigint"?s.toString():s}const b=Error.captureStackTrace?Error.captureStackTrace:(...r)=>{};function d(r){return typeof r=="string"?r:r?.message}function E(r,s,o){const e={...r,path:r.path??[]};if(!r.message){const a=d(r.inst?._zod.def?.error?.(r))??d(s?.error?.(r))??d(o.customError?.(r))??d(o.localeError?.(r))??"Invalid input";e.message=a}return delete e.inst,delete e.continue,s?.reportInput||delete e.input,e}const P=(r,s)=>{r.name="$ZodError",Object.defineProperty(r,"_zod",{value:r._zod,enumerable:!1}),Object.defineProperty(r,"issues",{value:s,enumerable:!1}),Object.defineProperty(r,"message",{get(){return JSON.stringify(s,w,2)},enumerable:!0}),Object.defineProperty(r,"toString",{value:()=>r.message,enumerable:!1})},O=g("$ZodError",P),_=g("$ZodError",P,{Parent:Error}),S=r=>(s,o,e,a)=>{const i=e?Object.assign(e,{async:!1}):{async:!1},n=s._zod.run({value:o,issues:[]},i);if(n instanceof Promise)throw new j;if(n.issues.length){const t=new(a?.Err??r)(n.issues.map(c=>E(c,i,m())));throw b(t,a?.callee),t}return n.value},A=S(_),Z=r=>async(s,o,e,a)=>{const i=e?Object.assign(e,{async:!0}):{async:!0};let n=s._zod.run({value:o,issues:[]},i);if(n instanceof Promise&&(n=await n),n.issues.length){const t=new(a?.Err??r)(n.issues.map(c=>E(c,i,m())));throw b(t,a?.callee),t}return n.value},N=Z(_);function h(r,s){try{var o=r()}catch(e){return s(e)}return o&&o.then?o.then(void 0,s):o}function I(r,s){for(var o={};r.length;){var e=r[0],a=e.code,i=e.message,n=e.path.join(".");if(!o[n])if("unionErrors"in e){var t=e.unionErrors[0].errors[0];o[n]={message:t.message,type:t.code}}else o[n]={message:i,type:a};if("unionErrors"in e&&e.unionErrors.forEach(function(f){return f.errors.forEach(function(l){return r.push(l)})}),s){var c=o[n].types,u=c&&c[e.code];o[n]=v(n,s,o,a,u?[].concat(u,e.message):e.message)}r.shift()}return o}function U(r,s){for(var o={};r.length;){var e=r[0],a=e.code,i=e.message,n=e.path.join(".");if(!o[n])if(e.code==="invalid_union"&&e.errors.length>0){var t=e.errors[0][0];o[n]={message:t.message,type:t.code}}else o[n]={message:i,type:a};if(e.code==="invalid_union"&&e.errors.forEach(function(f){return f.forEach(function(l){return r.push(l)})}),s){var c=o[n].types,u=c&&c[e.code];o[n]=v(n,s,o,a,u?[].concat(u,e.message):e.message)}r.shift()}return o}function k(r,s,o){if(o===void 0&&(o={}),(function(e){return"_def"in e&&typeof e._def=="object"&&"typeName"in e._def})(r))return function(e,a,i){try{return Promise.resolve(h(function(){return Promise.resolve(r[o.mode==="sync"?"parse":"parseAsync"](e,s)).then(function(n){return i.shouldUseNativeValidation&&p({},i),{errors:{},values:o.raw?Object.assign({},e):n}})},function(n){if((function(t){return Array.isArray(t?.issues)})(n))return{values:{},errors:y(I(n.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw n}))}catch(n){return Promise.reject(n)}};if((function(e){return"_zod"in e&&typeof e._zod=="object"})(r))return function(e,a,i){try{return Promise.resolve(h(function(){return Promise.resolve((o.mode==="sync"?A:N)(r,e,s)).then(function(n){return i.shouldUseNativeValidation&&p({},i),{errors:{},values:o.raw?Object.assign({},e):n}})},function(n){if((function(t){return t instanceof O})(n))return{values:{},errors:y(U(n.issues,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw n}))}catch(n){return Promise.reject(n)}};throw new Error("Invalid input: not a Zod schema")}export{k as a};

File diff suppressed because one or more lines are too long