PageSourceSearch

https://parnaiba.pi.gov.br/build/assets/Create-C2q3kpds.js

js parnaiba.pi.gov.br collected 2026-10-02 06:32:49 UTC 11,968 bytes, 2 lines download raw bytes

1import{j as x,u as V,c as _,o as s,w as M,a as r,i as c,e as y,f as l,g as d,h as u,n as b,d as t,v as n,t as m,F as E,p as B,q as S,b as U}from"./app-DQxO7r3K.js";import{A as N}from"./AdminLayout-BwHnHM_V.js";import{s as f}from"./toast-qOw0Rj-T.js";import{T as q}from"./trash-2-49h2bOXt.js";/* empty css            */import"./Logo PMP BRANCO V-BbmQex8o.js";import"./users-D7ZoY6u6.js";import"./createLucideIcon-Bm1i9NFz.js";import"./user-4BPNvKSF.js";import"./chevron-down--EGeFbjX.js";import"./log-out-DTzvWm53.js";import"./house-BJZSQ99g.js";import"./newspaper-ZrpseLGS.js";import"./image-Bgh0fdDX.js";import"./file-text-DAr43Ltb.js";import"./clipboard-list-G2k3rzGC.js";import"./calendar-PYB0jEA3.js";import"./chevron-right-DWFKZAU1.js";import"./music-2-B7w9yktt.js";import"./key-ScmRPUrt.js";import"./search-C4AzObEe.js";import"./menu-BCwfqCTb.js";const A={class:"p-3 sm:p-4 lg:p-6 space-y-6"},F={class:"flex items-center gap-2 text-sm"},j={class:"bg-white dark:bg-slate-900 shadow-sm rounded-xl border border-gray-100 dark:border-slate-700 p-6"},D={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},L={class:"md:col-span-2"},P={key:0,class:"text-red-500 dark:text-red-400 text-xs mt-1"},T={class:"md:col-span-2"},z=["value"],G={key:0,class:"text-red-500 dark:text-red-400 text-xs mt-1"},I={key:0,class:"text-red-500 dark:text-red-400 text-xs mt-1"},J={key:0,class:"text-red-500 dark:text-red-400 text-xs mt-1"},R={class:"bg-gray-50 dark:bg-slate-800/50 p-4 rounded-lg border border-gray-200 dark:border-slate-600"},H={class:"grid grid-cols-1 md:grid-cols-4 gap-2"},$={key:0,class:"text-red-500 dark:text-red-400 text-xs mt-2"},O={class:"border-2 border-dashed border-gray-200 dark:border-slate-600 rounded-lg p-6 text-center bg-gray-50 dark:bg-slate-800/50"},W={for:"image-upload",class:"cursor-pointer block"},K={key:0,class:"flex flex-col items-center gap-2 text-gray-400 dark:text-slate-500"},Q={key:1,class:"relative inline-block"},X=["src"],Y={key:0,class:"text-red-500 dark:text-red-400 text-xs mt-1"},Z={class:"pt-2"},ee=["disabled"],re={key:0,class:"animate-spin h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},Ve={__name:"Create",props:{cargos:{type:Array,required:!0}},setup(k){const g=x(null),p=x(null),o=V({nome:"",cargo_id:"",email:"",numero:"",ordem_exibicao:0,endereco:{logradouro:"",bairro:"",numero:"",cep:"",complemento:""},image:null}),v=i=>{const e=i.target.files[0];if(e){o.image=e;const a=new FileReader;a.onload=C=>p.value=C.target.result,a.readAsDataURL(e)}},h=()=>{o.image=null,p.value=null,g.value&&(g.value.value="")},w=()=>{const i=new FormData;for(const e in o.data())e==="endereco"?i.append("endereco",JSON.stringify(o.endereco)):o[e]!==null&&o[e]!==void 0&&i.append(e,o[e]);o.post(route("equipes.store"),i,{preserveScroll:!0,formData:!0,onSuccess:()=>{f("Membro criado com sucesso!","success")},onError:()=>{f("Erro ao salvar. Verifique os campos.","error")}})};return(i,e)=>(s(),_(N,{title:"Adicionar Membro - Equipe de Governo"},{default:M(()=>[r("div",A,[r("nav",F,[r("button",{type:"button",onClick:e[0]||(e[0]=a=>i.$inertia.visit(i.route("equipes.index"))),class:"flex items-center gap-1 text-gray-500 dark:text-slate-400 hover:text-admin-primary dark:hover:text-[#8ab4e8] transition-colors"},[...e[10]||(e[10]=[r("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",class:"h-4 w-4 stroke-current"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})],-1),c(" Equipe de Governo ",-1)])]),e[11]||(e[11]=r("span",{class:"text-gray-300 dark:text-slate-600"},"/",-1)),e[12]||(e[12]=r("span",{class:"font-medium text-gray-700 dark:text-slate-300"},"Adicionar",-1))]),e[22]||(e[22]=r("h1",{class:"text-2xl font-bold text-admin-primary dark:text-[#8ab4e8]"},"Novo Membro da Equipe",-1)),r("div",j,[r("form",{onSubmit:y(w,["prevent"]),class:"space-y-5",enctype:"multipart/form-data"},[r("div",D,[r("div",L,[e[13]||(e[13]=r("label",{for:"nome",class:"block text-sm font-medium text-gray-700 dark:text-slate-300 mb-1.5"},[c(" Nome Completo "),r("span",{class:"text-red-500"},"*")],-1)),l(r("input",{id:"nome","onUpdate:modelValue":e[1]||(e[1]=a=>t(o).nome=a),type:"text",placeholder:"Ex: João Silva",class:b(["w-full py-2.5 px-3 text-sm bg-gray-50 dark:bg-slate-800 border border-gray-200 dark:border-slate-600 rounded-lg text-gray-900 dark:text-slate-100 placeholder-gray-400 dark:placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-admin-primary/20 focus:border-admin-primary dark:focus:border-admin-primary/60 transition-colors duration-200",t(o).errors.nome?"border-red-400 dark:border-red-500 focus:ring-red-200 dark:focus:ring-red-900/30":""])},null,2),[[n,t(o).nome]]),t(o).errors.nome?(s(),d("p",P,m(t(o).errors.nome),1)):u("",!0)]),r("div",T,[e[15]||(e[15]=r("label",{for:"cargo_id",class:"block text-sm font-medium text-gray-700 dark:text-slate-300 mb-1.5"},[c(" Cargo "),r("span",{class:"text-red-500"},"*")],-1)),l(r("select",{id:"cargo_id","onUpdate:modelValue":e[2]||(e[2]=a=>
1t(o).cargo_id=a),class:b(["w-full py-2.5 px-3 text-sm bg-gray-50 dark:bg-slate-800 border border-gray-200 dark:border-slate-600 rounded-lg text-gray-900 dark:text-slate-100 focus:outline-none focus:ring-2 focus:ring-admin-primary/20 focus:border-admin-primary dark:focus:border-admin-primary/60 transition-colors duration-200",t(o).errors.cargo_id?"border-red-400 dark:border-red-500 focus:ring-red-200 dark:focus:ring-red-900/30":""])},[e[14]||(e[14]=r("option",{value:""},"Selecione o cargo...",-1)),(s(!0),d(E,null,B(k.cargos,a=>(s(),d("option",{key:a.id,value:a.id},m(a.descricao),9,z))),128))],2),[[S,t(o).cargo_id]]),t(o).errors.cargo_id?(s(),d("p",G,m(t(o).errors.cargo_id),1)):u("",!0)]),r("div",null,[e[16]||(e[16]=r("label",{for:"email",class:"block text-sm font-medium text-gray-700 dark:text-slate-300 mb-1.5"},"E-mail",-1)),l(r("input",{id:"email","onUpdate:modelValue":e[3]||(e[3]=a=>t(o).email=a),type:"email",placeholder:"[email protected]",class:b(["w-full py-2.5 px-3 text-sm bg-gray-50 dark:bg-slate-800 border border-gray-200 dark:border-slate-600 rounded-lg text-gray-900 dark:text-slate-100 placeholder-gray-400 dark:placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-admin-primary/20 focus:border-admin-primary dark:focus:border-admin-primary/60 transition-colors duration-200",t(o).errors.email?"border-red-400 dark:border-red-500":""])},null,2),[[n,t(o).email]]),t(o).errors.email?(s(),d("p",I,m(t(o).errors.email),1)):u("",!0)]),r("div",null,[e[17]||(e[17]=r("label",{for:"numero",class:"block text-sm font-medium text-gray-700 dark:text-slate-300 mb-1.5"},"Contato (Tel/Ramal)",-1)),l(r("input",{id:"numero","onUpdate:modelValue":e[4]||(e[4]=a=>t(o).numero=a),type:"text",placeholder:"(86) 0000-0000",class:"w-full py-2.5 px-3 text-sm bg-gray-50 dark:bg-slate-800 border border-gray-200 dark:border-slate-600 rounded-lg text-gray-900 dark:text-slate-100 placeholder-gray-400 dark:placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-admin-primary/20 focus:border-admin-primary dark:focus:border-admin-primary/60 transition-colors duration-200"},null,512),[[n,t(o).numero]]),t(o).errors.numero?(s(),d("p",J,m(t(o).errors.numero),1)):u("",!0)])]),r("fieldset",R,[e[18]||(e[18]=r("legend",{class:"font-bold text-[10px] uppercase text-gray-500 dark:text-slate-400 tracking-widest px-1 mb-3"}," Endereço de Atendimento ",-1)),r("div",H,[l(r("input",{"onUpdate:modelValue":e[5]||(e[5]=a=>t(o).endereco.cep=a),placeholder:"CEP",class:"md:col-span-4 py-2.5 px-3 text-sm bg-white dark:bg-slate-800 border border-gray-200 dark:border-slate-600 rounded-lg text-gray-900 dark:text-slate-100 placeholder-gray-400 dark:placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-admin-primary/20 focus:border-admin-primary dark:focus:border-admin-primary/60 transition-colors"},null,512),[[n,t(o).endereco.cep]]),l(r("input",{"onUpdate:modelValue":e[6]||(e[6]=a=>t(o).endereco.bairro=a),placeholder:"Bairro",class:"md:col-span-4 py-2.5 px-3 text-sm bg-white dark:bg-slate-800 border border-gray-200 dark:border-slate-600 rounded-lg text-gray-900 dark:text-slate-100 placeholder-gray-400 dark:placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-admin-primary/20 focus:border-admin-primary dark:focus:border-admin-primary/60 transition-colors"},null,512),[[n,t(o).endereco.bairro]]),l(r("input",{"onUpdate:modelValue":e[7]||(e[7]=a=>t(o).endereco.logradouro=a),placeholder:"Logradouro",class:"md:col-span-4 py-2.5 px-3 text-sm bg-white dark:bg-slate-800 border border-gray-200 dark:border-slate-600 rounded-lg text-gray-900 dark:text-slate-100 placeholder-gray-400 dark:placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-admin-primary/20 focus:border-admin-primary dark:focus:border-admin-primary/60 transition-colors"},null,512),[[n,t(o).endereco.logradouro]]),l(r("input",{"onUpdate:modelValue":e[8]||(e[8]=a=>t(o).endereco.numero=a),placeholder:"Nº",class:"md:col-span-2 py-2.5 px-3 text-sm bg-white dark:bg-slate-800 border border-gray-200 dark:border-slate-600 rounded-lg text-gray-900 dark:text-slate-100 placeholder-gray-400 dark:placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-admin-primary/20 focus:border-admin-primary dark:focus:border-admin-primary/60 transition-colors"},null,512),[[n,t(o).endereco.numero]]),l(r("input",{"onUpdate:modelValue":e[9]||(e[9]=a=>t(o).endereco.complemento=a),placeholder:"Complemento",class:"md:col-span-2 py-2.5 px-3 text-sm bg-white dark:bg-slate-800 border border-gray-200 dark:border-slate-600 rounded-lg text-gray-900 dark:text-slate-100 placeholder-gray-400 dark:placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-admin-primary/20 focus:border-admin-primary dark:focus:border-admin-primary/60 transition-colors"},null,512),[[n,t(o).endereco.complemento]])]),t(o).errors.endereco?(s(),d("p",$,m(t(o).errors.endereco),1)):u("",!0)]),r("div",null,[e[20]||(e[20]=r("label",{class:"block text-sm font-medium text-gray-700 dark:text-slate-300 mb-1.5"},"Foto do Membro",-1)),r("div",O,[r("input",{type:"file",accept:"image/*",onChange:v,class:"hidden",id:"image-upload",ref_key:"fileInput",ref:g},null,544),r("label",W,[p.value?(s(),d("div",Q,[r("img",{src:p.value,alt:"Pré
1-visualização",class:"max-h-40 rounded shadow object-contain"},null,8,X),r("button",{type:"button",onClick:y(h,["prevent"]),class:"absolute -top-2 -right-2 w-5 h-5 rounded-full bg-red-600 hover:bg-red-700 text-white flex items-center justify-center transition-colors"},[U(t(q),{class:"w-3 h-3"})])])):(s(),d("div",K,[...e[19]||(e[19]=[r("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-10 h-10",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})],-1),r("span",{class:"text-sm"},"Selecionar imagem",-1),r("span",{class:"text-xs text-gray-400 dark:text-slate-500"},"JPG, PNG, WEBP ou GIF (até 500 MB)",-1)])]))])]),t(o).errors.image?(s(),d("p",Y,m(t(o).errors.image),1)):u("",!0)]),r("div",Z,[r("button",{type:"submit",disabled:t(o).processing,class:"w-full py-2.5 px-4 bg-admin-primary hover:bg-admin-primary-dark text-white text-sm font-medium rounded-lg transition-colors duration-200 disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2"},[t(o).processing?(s(),d("svg",re,[...e[21]||(e[21]=[r("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),r("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"},null,-1)])])):u("",!0),c(" "+m(t(o).processing?"Salvando…":"Confirmar"),1)],8,ee)])],32)])])]),_:1}))}};export{Ve as default};
2//# sourceMappingURL=Create-C2q3kpds.js.map

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.