import{L as w}from"./Layout-BEAmuehS.js";import{T as k}from"./TextInput-D6G3wYlu.js";import{S as C}from"./SelectInput-Bl1ROfev.js";import{T as V}from"./TextareaInput-DxBbHHRp.js";import{L as h}from"./LoadingButton-fIGCYE5-.js";import{Z as v,i as L,r as s,c as d,o as m,a as i,b as l,d as T,w as u,t as n,F as x,j as B,e as I}from"./app-BLo7SiiE.js";import{_ as U,g as f,B as E,E as S,I as H,M as F,P as M,U as A,H as D,a as N,L as P,b as R,T as j,c as K,d as Q,e as q,f as Z,C as z}from"./UploadAdapter-C3Raf4xx.js";import{_ as G}from"./FlashMessages-DImpr6PL.js";import"./moment-C7JtfGJw.js";import"./v4-SoommWqA.js";const J={metaInfo:{title:"Create Knowledge Base"},components:{LoadingButton:h,SelectInput:C,TextareaInput:V,TextInput:k,Link:L,Head:v,Ckeditor:U},layout:w,props:{title:String,types:Array},remember:"form",data(){return{editor:z,editorConfig:{plugins:[E,S,H,F,M,A,D,N,P,R,j,K,Q,q,Z],toolbar:["heading","|","bold","italic","link","bulletedList","numberedList","|","outdent","indent","|","insertTable","blockQuote","|","imageUpload","mediaEmbed","|","undo","redo"],table:{toolbar:["tableColumn","tableRow","mergeTableCells"]},extraPlugins:[function(e){e.plugins.get("FileRepository").createUploadAdapter=a=>new f(a)}]},form:this.$inertia.form({title:null,type_id:null,details:""})}},methods:{uploader(r){r.plugins.get("FileRepository").createUploadAdapter=e=>new f(e)},store(){this.form.post(this.route("knowledge_base.store"))}}},O={class:"bg-white rounded-md shadow overflow-hidden max-w-full"},W={class:"p-8 -mr-6 -mb-8 flex flex-wrap"},X={value:null},Y=["value"],$={class:"pr-6 pb-8 w-full"},ee={class:"form-label"},te={class:"px-8 py-4 bg-gray-50 border-t border-gray-100 flex justify-end items-center"};function oe(r,e,a,re,t,p){const c=s("Head"),b=s("text-input"),g=s("select-input"),_=s("ckeditor"),y=s("loading-button");return m(),d("div",null,[i(c,{title:r.$t(a.title)},null,8,["title"]),l("div",O,[l("form",{onSubmit:e[3]||(e[3]=T((...o)=>p.store&&p.store(...o),["prevent"]))},[l("div",W,[i(b,{modelValue:t.form.title,"onUpdate:modelValue":e[0]||(e[0]=o=>t.form.title=o),error:t.form.errors.title,class:"pr-6 pb-8 w-full lg:w-1/2",label:r.$t("Title")},null,8,["modelValue","error","label"]),i(g,{modelValue:t.form.type_id,"onUpdate:modelValue":e[1]||(e[1]=o=>t.form.type_id=o),error:t.form.errors.type_id,class:"pr-6 pb-8 w-full lg:w-1/3",label:r.$t("Type"),required:!0},{default:u(()=>[l("option",X,n(r.$t("Select type")),1),(m(!0),d(x,null,B(a.types,o=>(m(),d("option",{key:o.id,value:o.id},n(o.name),9,Y))),128))]),_:1},8,["modelValue","error","label"]),l("div",$,[l("label",ee,n(r.$t("Details"))+":",1),i(_,{id:"ticketDetails",editor:t.editor,modelValue:t.form.details,"onUpdate:modelValue":e[2]||(e[2]=o=>t.form.details=o),error:t.form.errors.details,config:t.editorConfig},null,8,["editor","modelValue","error","config"])])]),l("div",te,[i(y,{loading:t.form.processing,class:"btn-indigo",type:"submit"},{default:u(()=>[I(n(r.$t("Create Knowledge Base")),1)]),_:1},8,["loading"])])],32)])])}const ce=G(J,[["render",oe]]);export{ce as default};
