import{T as v,c as l,a as b,b as e,w as f,t as a,d,v as u,u as t,e as c,f as h,F as y,r as k,y as p,o as r,q as w}from"./app-13978987.js";import{_ as V}from"./PageHeader-8c638686.js";import{_ as x}from"./AdminLayout-bd13ff9d.js";import"./dropdown-45d66330.js";const M={class:"container flex-grow p-4 sm:p-6"},S={class:"space-y-6"},q={class:"grid grid-cols-5"},U={class:"col-span-2"},C={class:"col-span-3"},I={class:"card"},B={class:"card-body"},D={class:"mb-2"},F={class:""},N={class:""},T={key:0,class:"invalid-feedback text-red-600"},j={class:"mt-2"},L={class:""},$={class:""},A={key:0,class:"invalid-feedback text-red-600"},E={class:"mt-2"},O={class:""},P={class:""},z={key:0,class:"invalid-feedback text-red-600"},G={class:"mt-2"},H={class:""},J={class:""},K={key:0,class:"invalid-feedback text-red-600"},Q={class:"mt-3"},R={class:""},W={class:""},X={key:0,class:"invalid-feedback text-red-600"},Y={class:"mt-2"},Z={class:""},ee={class:""},se=["value"],te={key:0,class:"invalid-feedback text-red-600"},ae={class:"mt-2"},oe={for:"toggle-featured",class:"toggle toggle-sm"},ie=e("div",{class:"toggle-body"},null,-1),ne={class:"label label-md"},le={for:"toggle-status",class:"toggle toggle-sm"},re=e("div",{class:"toggle-body"},null,-1),de={class:"label label-md"},ce={class:"mt-5"},ue={class:"btn btn-primary"},_e={layout:x},be=Object.assign(_e,{__name:"Create",props:["languages","segments","buttons"],setup(_){const s=v({title:"",preview_image:"",banner_image:"",description:"",main_description:"",language:"",featured:!1,status:!1}),g=()=>{const n=route("admin.features.store");s.post(n,{onSuccess:()=>{w.success(trans("Item has been added successfully"))}})};return(n,i)=>(r(),l("main",M,[b(V,{title:n.trans("Create Feature"),buttons:_.buttons},null,8,["title","buttons"]),e("div",S,[e("form",{onSubmit:f(g,["prevent"]),class:"ajaxform_instant_reload",enctype:"multipart/form-data"},[e("div",q,[e("div",U,[e("strong",null,a(n.trans("Create a features post")),1),e("p",null,a(n.trans("Add your features details and necessary information from here")),1)]),e("div",C,[e("div",I,[e("div",B,[e("div",D,[e("label",F,a(n.trans("Features Title")),1),e("div",N,[d(e("input",{type:"text","onUpdate:modelValue":i[0]||(i[0]=o=>t(s).title=o),name:"title",required:"",class:"input"},null,512),[[u,t(s).title]]),t(s).errors.title?(r(),l("div",T,a(t(s).errors.title),1)):c("",!0)])]),e("div",j,[e("label",L,a(n.trans("Preview Image")),1),e("div",$,[e("input",{onInput:i[1]||(i[1]=o=>t(s).preview_image=o.target.files[0]),type:"file",class:"input",required:"",name:"preview_image",accept:"image/*"},null,32),t(s).errors.preview_image?(r(),l("div",A,a(t(s).errors.preview_image),1)):c("",!0)])]),e("div",E,[e("label",O,a(n.trans("Banner Image")),1),e("div",P,[e("input",{onInput:i[2]||(i[2]=o=>t(s).banner_image=o.target.files[0]),type:"file",class:"input",required:"",name:"banner_image",accept:"image/*"},null,32),t(s).errors.banner_image?(r(),l("div",z,a(t(s).errors.banner_image),1)):c("",!0)])]),e("div",G,[e("label",H,a(n.trans("Short Description")),1),e("div",J,[d(e("textarea",{"onUpdate:modelValue":i[3]||(i[3]=o=>t(s).description=o),name:"description",required:"",class:"textarea h-100",maxlength:"500"},null,512),[[u,t(s).description]]),t(s).errors.description?(r(),l("div",K,a(t(s).errors.description),1)):c("",!0)])]),e("div",Q,[e("label",R,a(n.trans("Main Description")),1),e("div",W,[d(e("textarea",{"onUpdate:modelValue":i[4]||(i[4]=o=>t(s).main_description=o),name:"main_description",required:"",class:"h-200 textarea"},null,512),[[u,t(s).main_description]]),t(s).errors.main_description?(r(),l("div",X,a(t(s).errors.main_description),1)):c("",!0)])]),e("div",Y,[e("label",Z,a(n.trans("Select Langauge")),1),e("div",ee,[d(e("select",{"onUpdate:modelValue":i[5]||(i[5]=o=>t(s).language=o),name:"language",class:"select"},[(r(!0),l(y,null,k(_.languages,(o,m)=>(r(),l("option",{key:m,value:m},a(o),9,se))),128))],512),[[h,t(s).language]]),t(s).errors.language?(r(),l("div",te,a(t(s).errors.language),1)):c("",!0)])]),e("div",ae,[e("div",null,[e("label",oe,[d(e("input",{"onUpdate:modelValue":i[6]||(i[6]=o=>t(s).featured=o),class:"toggle-input peer sr-only",id:"toggle-featured",type:"checkbox"},null,512),[[p,t(s).featured]]),ie,e("span",ne,a(n.trans("Make it featured?")),1)])]),e("div",null,[e("label",le,[d(e("input",{"onUpdate:modelValue":i[7]||(i[7]=o=>t(s).status=o),class:"toggle-input peer sr-only",id:"toggle-status",type:"checkbox"},null,512),[[p,t(s).status]]),re,e("span",de,a(n.trans("Make it publish?")),1)])])]),e("div",ce,[e("button",ue,a(n.trans("Submit")),1)])])])])])],32)])]))}});export{be as default};
