import{aq as x,C as n,l as d,n as t,q as s,v as l,u as o,t as a,x as m,M as k,N as g,A as p,B as u,D as b,_ as z,p as f}from"./Button-d1z8wTLU.js";import{u as v}from"./app-DoBSDxTb.js";import{_ as y}from"./LayoutInfoprodutor-YH0r2AVK.js";import"./usePwaInstall-BhXgK-nU.js";import"./smartphone-De3EtBt6.js";import"./x-D0-XOdNy.js";import"./circle-dollar-sign-CVK7YGuf.js";import"./users-Cijq9b7H.js";import"./mail-BHCn6qHy.js";import"./file-code-CgKCKtqj.js";import"./ThemeToggler-O9cubuF5.js";import"./external-link-BSg-vtFm.js";import"./check-DMFnGJz1.js";import"./circle-check-BnpJeIOu.js";const w={class:"space-y-4"},V={key:0,class:"mt-1 text-sm text-red-600"},C={class:"grid gap-4 sm:grid-cols-2"},N={key:0,class:"mt-1 text-sm text-red-600"},U={class:"flex items-center gap-2"},_={class:"flex gap-2"},H=Object.assign({layout:y},{__name:"Create",setup(M){const r=v({name:"",slug:"",description:"",type:"area_membros",price:0,is_active:!0});return(S,e)=>{const c=x("Link");return n(),d("div",w,[t("form",{class:"max-w-xl space-y-4",onSubmit:e[6]||(e[6]=f(i=>o(r).post("/produtos"),["prevent"]))},[t("div",null,[e[7]||(e[7]=t("label",{class:"block text-sm font-medium text-zinc-700 dark:text-zinc-300"},"Nome",-1)),s(t("input",{"onUpdate:modelValue":e[0]||(e[0]=i=>o(r).name=i),type:"text",required:"",class:"mt-1 block w-full rounded-lg border border-zinc-300 dark:border-zinc-600 bg-white dark:bg-zinc-900 px-3 py-2"},null,512),[[l,o(r).name]]),o(r).errors.name?(n(),d("p",V,a(o(r).errors.name),1)):m("",!0)]),t("div",null,[e[8]||(e[8]=t("label",{class:"block text-sm font-medium text-zinc-700 dark:text-zinc-300"},"Slug (opcional)",-1)),s(t("input",{"onUpdate:modelValue":e[1]||(e[1]=i=>o(r).slug=i),type:"text",class:"mt-1 block w-full rounded-lg border border-zinc-300 dark:border-zinc-600 bg-white dark:bg-zinc-900 px-3 py-2"},null,512),[[l,o(r).slug]])]),t("div",null,[e[9]||(e[9]=t("label",{class:"block text-sm font-medium text-zinc-700 dark:text-zinc-300"},"Descrição",-1)),s(t("textarea",{"onUpdate:modelValue":e[2]||(e[2]=i=>o(r).description=i),rows:"3",class:"mt-1 block w-full rounded-lg border border-zinc-300 dark:border-zinc-600 bg-white dark:bg-zinc-900 px-3 py-2"},null,512),[[l,o(r).description]])]),t("div",C,[t("div",null,[e[11]||(e[11]=t("label",{class:"block text-sm font-medium text-zinc-700 dark:text-zinc-300"},"Tipo",-1)),s(t("select",{"onUpdate:modelValue":e[3]||(e[3]=i=>o(r).type=i),class:"mt-1 block w-full rounded-lg border border-zinc-300 dark:border-zinc-600 bg-white dark:bg-zinc-900 px-3 py-2"},[...e[10]||(e[10]=[t("option",{value:"area_membros"},"Área de membros",-1),t("option",{value:"link"},"Link",-1),t("option",{value:"link_pagamento"},"Somente link de pagamento",-1)])],512),[[k,o(r).type]])]),t("div",null,[e[12]||(e[12]=t("label",{class:"block text-sm font-medium text-zinc-700 dark:text-zinc-300"},"Preço (R$)",-1)),s(t("input",{"onUpdate:modelValue":e[4]||(e[4]=i=>o(r).price=i),type:"number",step:"0.01",min:"0",required:"",class:"mt-1 block w-full rounded-lg border border-zinc-300 dark:border-zinc-600 bg-white dark:bg-zinc-900 px-3 py-2"},null,512),[[l,o(r).price]]),o(r).errors.price?(n(),d("p",N,a(o(r).errors.price),1)):m("",!0)])]),t("div",U,[s(t("input",{"onUpdate:modelValue":e[5]||(e[5]=i=>o(r).is_active=i),type:"checkbox",id:"is_active",class:"h-4 w-4 rounded border-zinc-300"},null,512),[[g,o(r).is_active]]),e[13]||(e[13]=t("label",{for:"is_active",class:"text-sm text-zinc-700 dark:text-zinc-300"},"Ativo",-1))]),t("div",_,[p(z,{type:"submit",disabled:o(r).processing},{default:u(()=>[...e[14]||(e[14]=[b("Criar",-1)])]),_:1},8,["disabled"]),p(c,{href:"/produtos",class:"inline-flex items-center rounded-lg border border-zinc-300 dark:border-zinc-600 px-4 py-2 text-sm font-medium"},{default:u(()=>[...e[15]||(e[15]=[b("Cancelar",-1)])]),_:1})])],32)])}}});export{H as default};
