1import{c as W,a as X,j as t}from"./app-CTaY8UJf.js";import{B as K}from"./button-DXCKLHtj.js";import{C as Y,a as Z,b as ee,c as te}from"./card-UxP9oPxk.js";import{I as M}from"./input-7aHhCeCr.js";import{L as G}from"./label-CxCrcTSv.js";import"./app-CNmQMdEi.js";import"./index-fQ3brVpV.js";const P="/admin/outras-receitas";function pe(R){const e=W.c(65),{item:s,types:T,isEdit:J}=R,r=J===void 0?!1:J,$=s?.title??"",z=s?.type??"",L=r?"put":"post";let S;e[0]!==$||e[1]!==z||e[2]!==L?(S={title:$,type:z,path:null,_method:L},e[0]=$,e[1]=z,e[2]=L,e[3]=S):S=e[3];const{data:l,setData:i,post:O,processing:F,errors:a}=X(S);let E;e[4]!==r||e[5]!==s||e[6]!==O?(E=o=>{o.preventDefault();const U=r&&s?.id?`${P}/${s.id}`:P;O(U,{forceFormData:!0})},e[4]=r,e[5]=s,e[6]=O,e[7]=E):E=e[7];const H=E;let k;e[8]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Y,{children:t.jsx(Z,{children:"Dados da receita"})}),e[8]=k):k=e[8];let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(G,{htmlFor:"title",children:"TÃtulo *"}),e[9]=w):w=e[9];let n;e[10]!==i?(n=o=>i("title",o.target.value),e[10]=i,e[11]=n):n=e[11];let c;e[12]!==l.title||e[13]!==n?(c=t.jsx(M,{id:"title",value:l.title,onChange:n,placeholder:"Informe o tÃtulo"}),e[12]=l.title,e[13]=n,e[14]=c):c=e[14];let m;e[15]!==a.title?(m=a.title&&t.jsx("p",{className:"text-sm text-red-600",children:a.title}),e[15]=a.title,e[16]=m):m=e[16];let p;e[17]!==c||e[18]!==m?(p=t.jsxs("div",{className:"space-y-2 md:col-span-2",children:[w,c,m]}),e[17]=c,e[18]=m,e[19]=p):p=e[19];let D;e[20]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(G,{htmlFor:"type",children:"Tipo *"}),e[20]=D):D=e[20];const Q=l.type;let d;e[21]!==i?(d=o=>i("type",o.target.value),e[21]=i,e[22]=d):d=e[22];let q;e[23]===Symbol.for("react.memo_cache_sentinel")?(q=t.jsx("option",{value:"",children:"Selecione..."}),e[23]=q):q=e[23];let h;e[24]!==T?(h=Object.entries(T).map(se),e[24]=T,e[25]=h):h=e[25];let f;e[26]!==l.type||e[27]!==d||e[28]!==h?(f=t.jsxs("select",{id:"type",value:Q,onChange:d,className:"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm",children:[q,h]}),e[26]=l.type,e[27]=d,e[28]=h,e[29]=f):f=e[29];let u;e[30]!==a.type?(u=a.type&&t.jsx("p",{className:"text-sm text-red-600",children:a.type}),e[30]=a.type,e[31]=u):u=e[31];let x;e[32]!==f||e[33]!==u?(x=t.jsxs("div",{className:"space-y-2",children:[D,f,u]}),e[32]=f,e[33]=u,e[34]=x):x=e[34];let A;e[35]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(G,{htmlFor:"path",children:"Arquivo"}),e[35]=A):A=e[35];let y;e[36]!==i?(y=t.jsx(M,{id:"path",type:"file",onChange:o=>i("path",o.target.files?.[0]??null)}),e[36]=i,e[37]=y):y=e[37];let j;e[38]!==a.path?(j=a.path&&t.jsx("p",{className:"text-sm text-red-600",children:a.path}),e[38]=a.path,e[39]=j):j=e[39];let b;e[40]!==l.path||e[41]!==r||e[42]!==s?(b=r&&s?.path_url&&!l.path&&t.jsx("a",{href:s.path_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-2 text-sm text-blue-600 hover:underline",children:"Visualizar arquivo atual"}),e[40]=l.path,e[41]=r,e[42]=s,e[43]=b):b=e[43];let v;e[44]!==l.path?(v=l.path&&t.jsxs("p",{className:"text-sm text-gray-500",children:["Novo arquivo selecionado: ",l.path.name]}),e[44]=l.path,e[45]=v):v=e[45];let _;
1e[46]!==y||e[47]!==j||e[48]!==b||e[49]!==v?(_=t.jsxs("div",{className:"space-y-2",children:[A,y,j,b,v]}),e[46]=y,e[47]=j,e[48]=b,e[49]=v,e[50]=_):_=e[50];let g;e[51]!==p||e[52]!==x||e[53]!==_?(g=t.jsxs(ee,{children:[k,t.jsxs(te,{className:"grid grid-cols-1 gap-6 md:grid-cols-2",children:[p,x,_]})]}),e[51]=p,e[52]=x,e[53]=_,e[54]=g):g=e[54];const V=F?"Salvando...":r?"Atualizar":"Cadastrar";let N;e[55]!==F||e[56]!==V?(N=t.jsx(K,{type:"submit",disabled:F,children:V}),e[55]=F,e[56]=V,e[57]=N):N=e[57];let B;e[58]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx(K,{type:"button",variant:"outline",onClick:le,children:"Cancelar"}),e[58]=B):B=e[58];let C;e[59]!==N?(C=t.jsxs("div",{className:"flex flex-wrap gap-3",children:[N,B]}),e[59]=N,e[60]=C):C=e[60];let I;return e[61]!==H||e[62]!==g||e[63]!==C?(I=t.jsxs("form",{onSubmit:H,className:"space-y-6",children:[g,C]}),e[61]=H,e[62]=g,e[63]=C,e[64]=I):I=e[64],I}function le(){return window.history.back()}function se(R){const[e,s]=R;return t.jsx("option",{value:e,children:s},e)}export{pe 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.