import{L as g}from"./Layout-DhxLvS0V.js";import{T as w}from"./TextInput-UGcC5hIa.js";import{S as h}from"./SelectInput-BeV75IPk.js";import{T as V}from"./TextareaInput-BCCh4Nha.js";import{L as v}from"./LoadingButton-BqD68voa.js";import{X as x,B as k,C as s,j as m,t as a,m as i,k as r,H as B,E as u,y as n,F as C,q as T,z as L,x as S}from"./vendor-CoimUlS3.js";import{_ as E}from"./RichEditor-5gaZmhKN.js";import{_ as H}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./LogoutButton-BZlSuKxY.js";import"./app-W9XHfen4.js";import"./utils-CXPYudwi.js";/* empty css                                                                 */import"./ui-CI37mw-K.js";import"./Logo-DiOikIGZ.js";import"./FlashMessages-D1juQjH6.js";const I={metaInfo:{title:"Create Knowledge Base"},components:{LoadingButton:v,SelectInput:h,TextareaInput:V,TextInput:w,Link:k,Head:x,RichEditor:E},layout:g,props:{title:String,types:Array},remember:"form",data(){return{form:this.$inertia.form({title:null,type_id:null,details:""})}},methods:{store(){this.form.post(this.route("knowledge_base.store"))}}},N={class:"bg-white rounded-md shadow overflow-hidden max-w-full"},R={class:"p-8 -mr-6 -mb-8 flex flex-wrap"},U={value:null},j=["value"],q={class:"pr-6 pb-8 w-full"},D={class:"form-label"},F={key:0,class:"text-red-600 text-sm mt-1"},K={class:"px-8 py-4 bg-gray-50 border-t border-gray-100 flex justify-end items-center"};function z(l,o,d,A,e,p){const f=s("Head"),_=s("text-input"),c=s("select-input"),b=s("RichEditor"),y=s("loading-button");return a(),m("div",null,[i(f,{title:l.$t(d.title)},null,8,["title"]),r("div",N,[r("form",{onSubmit:o[3]||(o[3]=B((...t)=>p.store&&p.store(...t),["prevent"]))},[r("div",R,[i(_,{modelValue:e.form.title,"onUpdate:modelValue":o[0]||(o[0]=t=>e.form.title=t),error:e.form.errors.title,class:"pr-6 pb-8 w-full lg:w-1/2",label:l.$t("Title")},null,8,["modelValue","error","label"]),i(c,{modelValue:e.form.type_id,"onUpdate:modelValue":o[1]||(o[1]=t=>e.form.type_id=t),error:e.form.errors.type_id,class:"pr-6 pb-8 w-full lg:w-1/3",label:l.$t("Type"),required:!0},{default:u(()=>[r("option",U,n(l.$t("Select type")),1),(a(!0),m(C,null,T(d.types,t=>(a(),m("option",{key:t.id,value:t.id},n(t.name),9,j))),128))]),_:1},8,["modelValue","error","label"]),r("div",q,[r("label",D,n(l.$t("Details"))+":",1),i(b,{modelValue:e.form.details,"onUpdate:modelValue":o[2]||(o[2]=t=>e.form.details=t),class:"mt-1"},null,8,["modelValue"]),e.form.errors.details?(a(),m("div",F,n(e.form.errors.details),1)):L("",!0)])]),r("div",K,[i(y,{loading:e.form.processing,class:"btn-indigo",type:"submit"},{default:u(()=>[S(n(l.$t("Create Knowledge Base")),1)]),_:1},8,["loading"])])],32)])])}const le=H(I,[["render",z]]);export{le as default};
