(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,2323,e=>{"use strict";e.s(["adminInputCls",0,"w-full rounded-lg border border-[#d9e2f7] bg-white px-3.5 py-2.5 text-sm text-[#132b87] placeholder:text-[#a5b0cc] focus:outline-none focus:border-[#1f3fb8] focus:ring-2 focus:ring-[#1f3fb8]/15 transition","adminLabelCls",0,"block text-xs font-medium text-[#5a688d] mb-1.5"])},40127,e=>{"use strict";var r=e.i(43476),t=e.i(2323);function a({message:e}){return e?(0,r.jsx)("p",{className:"mt-1 text-xs text-red-600",role:"alert",children:e}):null}e.s(["AdminField",0,function({label:e,name:s,children:l,error:i}){return(0,r.jsxs)("label",{className:"block",htmlFor:s,children:[(0,r.jsx)("span",{className:t.adminLabelCls,children:e}),l,(0,r.jsx)(a,{message:i})]})},"FieldError",0,a])},1713,e=>{"use strict";var r=e.i(43476),t=e.i(71645),a=e.i(40127),s=e.i(2323);e.s(["default",0,function({action:e,initial:l,submitLabel:i}){let[d,n,m]=(0,t.useActionState)(e,void 0);return(0,r.jsxs)("form",{action:n,className:"rounded-2xl border border-[#d9e2f7] bg-white p-5 sm:p-6 space-y-5 max-w-2xl",children:[(0,r.jsx)(a.AdminField,{label:"Title",name:"title",error:d?.errors?.title?.[0],children:(0,r.jsx)("input",{id:"title",name:"title",required:!0,defaultValue:l?.title??"",className:s.adminInputCls})}),(0,r.jsx)(a.AdminField,{label:"Category",name:"category",error:d?.errors?.category?.[0],children:(0,r.jsx)("input",{id:"category",name:"category",required:!0,defaultValue:l?.category??"",className:s.adminInputCls})}),(0,r.jsx)(a.AdminField,{label:"Excerpt",name:"excerpt",error:d?.errors?.excerpt?.[0],children:(0,r.jsx)("textarea",{id:"excerpt",name:"excerpt",required:!0,rows:4,defaultValue:l?.excerpt??"",className:`${s.adminInputCls} resize-y`})}),l?.imageUrl?(0,r.jsxs)("div",{className:"rounded-xl border border-[#e9eefc] bg-[#f8faff] p-3",children:[(0,r.jsx)("p",{className:"text-xs font-medium text-[#5a688d] mb-2",children:"Current image"}),(0,r.jsx)("img",{src:l.imageUrl,alt:l.title||"Blog image",className:"h-40 w-full rounded-lg object-cover"})]}):null,(0,r.jsx)(a.AdminField,{label:"Upload image",name:"image",children:(0,r.jsx)("input",{id:"image",name:"image",type:"file",accept:"image/jpeg,image/png,image/webp",className:s.adminInputCls})}),(0,r.jsx)("input",{type:"hidden",name:"imageUrl",defaultValue:l?.imageUrl??""}),(0,r.jsx)(a.AdminField,{label:"Sort order",name:"sortOrder",error:d?.errors?.sortOrder?.[0],children:(0,r.jsx)("input",{id:"sortOrder",name:"sortOrder",type:"number",min:0,defaultValue:l?.sortOrder??0,className:s.adminInputCls})}),(0,r.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,r.jsx)("input",{type:"checkbox",name:"featured",defaultChecked:l?.featured??!1,className:"accent-[#1f3fb8]"}),"Featured story"]}),(0,r.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,r.jsx)("input",{type:"checkbox",name:"published",defaultChecked:l?.published??!0,className:"accent-[#1f3fb8]"}),"Published on website"]}),(0,r.jsx)(a.FieldError,{message:d?.errors?.published?.[0]}),d?.message&&(0,r.jsx)("p",{className:"text-sm text-red-600",role:"alert",children:d.message}),(0,r.jsx)("button",{type:"submit",disabled:m,className:"rounded-full bg-[#1f3fb8] px-6 py-2.5 text-sm font-semibold text-white hover:bg-[#18339a] disabled:opacity-60",children:m?"Saving...":i})]})}])}]);