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