1/*! For license information please see 4953.5bfe68d9.chunk.js.LICENSE.txt */ 2"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[4953],{797(e,t,a){a.d(t,{A:()=>s});const s=(0,a(7784).A)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]])},2024(e,t,a){a.d(t,{A:()=>s});const s=(0,a(7784).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},4805(e,t,a){a.d(t,{A:()=>s});const s=(0,a(7784).A)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]])},4953(e,t,a){a.r(t),a.d(t,{default:()=>b});var s=a(9379),r=a(5043),n=a(7874),i=a(2024),l=a(6210),o=a(4805),d=a(797),c=a(614),p=a(8555),m=a.n(p),x=a(3046),h=a(2339),u=a(579);const b=()=>{const e=(0,n.Zp)(),t=(0,r.useRef)(null),[a,p]=(0,r.useState)(!1),[b,f]=(0,r.useState)(null),[g,v]=(0,r.useState)({first_name:"",last_name:"",origin:""}),[j,y]=(0,r.useState)(""),N=e=>{v((0,s.A)((0,s.A)({},g),{},{[e.target.name]:e.target.value}))},w=async(t,a)=>{if(t.preventDefault(),!g.first_name)return h.Ay.error("First name is required!");p(!0);const s=h.Ay.loading("Saving actor...");try{const t=new FormData;t.append("first_name",g.first_name),t.append("last_name",g.last_name),t.append("origin",g.origin),t.append("profile",j),b&&t.append("picture",b);const r="https://www.bagchee.com/api";(await x.A.post("".concat(r,"/actors/save"),t,{headers:{"Content-Type":"multipart/form-data"}})).data.status&&(h.Ay.success("Actor added successfully! \ud83c\udfad",{id:s}),"back"===a?e("/admin/actors"):(v({first_name:"",last_name:"",origin:""}),y(""),f(null)))}catch(i){var r,n;h.Ay.error((null===(r=i.response)||void 0===r||null===(n=r.data)||void 0===n?void 0:n.msg)||"Failed to save",{id:s})}finally{p(!1)}},A=(0,r.useMemo)(()=>({readonly:!1,height:300,theme:"default",placeholder:"Enter actor profile details...",buttons:["source","save","print","|","bold","italic","underline","strikethrough","|","superscript","subscript","|","ul","ol","|","outdent","indent","|","font","fontsize","brush","paragraph","|","image","table","link","|","align","undo","redo","|","hr","eraser","fullsize"]}),[]);return(0,u.jsxs)("div",{className:"bg-cream-50 min-h-screen font-body text-text-main pb-10",children:[(0,u.jsx)("div",{className:"bg-primary px-6 py-3 shadow-md flex items-center justify-between",children:(0,u.jsx)("h1",{className:"text-lg font-bold text-white uppercase tracking-slick font-display",children:"Add Actors"})}),(0,u.jsx)("div",{className:"max-w-6xl mx-auto p-6 mt-4",children:(0,u.jsxs)("form",{className:"bg-white rounded border border-cream-200 shadow-sm overflow-hidden",children:[(0,u.jsx)("div",{className:"bg-cream-100 px-6 py-3 border-b border-cream-200",children:(0,u.jsx)("h2",{className:"text-[11px] font-bold text-text-muted uppercase tracking-wider font-montserrat",children:"Actor Information"})}),(0,u.jsxs)("div",{className:"p-8 space-y-6",children:[(0,u.jsxs)("div",{className:"grid grid-cols-12 gap-4 items-center border-b border-cream-50 pb-4",children:[(0,u.jsx)("label",{className:"col-span-3 text-right text-[11px] font-bold text-text-muted uppercase font-montserrat",children:"First name*"}),(0,u.jsx)("div",{className:"col-span-9",children:(0,u.jsx)("input",{name:"first_name",value:g.first_name,onChange:N,className:"theme-input w-full",placeholder:"Enter first name"})})]}),(0,u.jsxs)("div",{className:"grid grid-cols-12 gap-4 items-center border-b border-cream-50 pb-4",children:[(0,u.jsx)("label",{className:"col-span-3 text-right text-[11px] font-bold text-text-muted uppercase font-montserrat",children:"Last name"}),(0,u.jsx)("div",{className:"col-span-9",children:(0,u.jsx)("input",{name:"last_name",value:g.last_name,onChange:N,className:"theme-input w-full",placeholder:"Enter last name"})})]}),(0,u.jsxs)("div",{className:"grid grid-cols-12 gap-4 items-center border-b border-cream-50 pb-4",children:[(0,u.jsx)("label",{className:"col-span-3 text-right text-[11px] font-bold text-text-muted uppercase font-montserrat",children:"Picture"}),(0,u.jsxs)("div",{className:"col-span-9 flex items-center gap-4",children:[(0,u.jsx)("input",{type:"file",id:"picture",className:"hidden",onChange:e=>f(e.target.files[0]),accept:"image/*"}),(0,u.jsxs)("label",{htmlFor:"picture",className:"cursor-pointer bg-cream-100 border border-cream-200 px-4 py-1.5 rounded text-[11px] font-bold uppercase hover:bg-cream-200 transition-all flex items-center gap-2 shadow-sm",children:[(0,u.jsx)(d.A,{size:14})," ",b?"Change file":"Upload a file"]}),b&&(0,u.jsx)("span",{className:"text-xs text-primary font-bold italic",children:b.name})]})]}),(0,u.jsxs)("div",{className:"grid grid-cols-12 gap-4 items-center border-b border-cream-50 pb-4",children:[(0,u.jsx)("label",{className:"col-span-3 text-right text-[11px] font-bold text-text-muted uppercase font-montserrat",children:"Origin"}),(0,u.jsx)("div",{className:"col-span-9",children:(0,u.jsx)("input",{name:"origin",value:g.origin,onChange:N,className:"theme-input w-full",placeholder:"e.g. USA, India"})})]}),(0,u.jsxs)("div",{className:"grid grid-cols-12 gap-4 items-start border-b border-cream-50 pb-6",children:[(0,u.jsx)("label",{className:"col-span-3 text-right text-[11px] font-bold text-text-muted uppercase font-montserrat pt-2",children:"Profile"}),(0,u.jsx)("div",{className:"col-span-9 border rounded-md overflow-hidden shadow-sm focus-within:ring-2 focus-within:ring-primary/10",children:(0,u.jsx)(m(),{ref:t,value:j,config:A,onBlur:e=>y(e)})})]}),(0,u.jsxs)("div",{className:"flex justify-center items-center gap-4 pt-8 border-t mt
2-4 font-montserrat",children:[(0,u.jsxs)("button",{onClick:e=>w(e,"stay"),disabled:a,className:"bg-primary text-white px-8 py-2.5 rounded font-bold text-[10px] uppercase shadow-md hover:brightness-110 active:scale-95 transition-all flex items-center gap-2",children:[a?(0,u.jsx)(i.A,{size:14,className:"animate-spin"}):(0,u.jsx)(l.A,{size:14})," Save"]}),(0,u.jsxs)("button",{onClick:e=>w(e,"back"),disabled:a,className:"bg-text-main text-white px-8 py-2.5 rounded font-bold text-[10px] uppercase shadow-md hover:opacity-90 active:scale-95 transition-all flex items-center gap-2",children:[(0,u.jsx)(o.A,{size:14})," Save & go back to list"]}),(0,u.jsxs)("button",{type:"button",onClick:()=>e("/admin/actors"),className:"bg-white border border-cream-200 text-text-main px-8 py-2.5 rounded font-bold text-[10px] uppercase shadow-sm hover:bg-cream-50 active:scale-95 transition-all flex items-center gap-2",children:[(0,u.jsx)(c.A,{size:14,className:"text-red-600"})," Cancel"]})]})]})]})}),(0,u.jsx)("style",{children:"\n .theme-input { \n border: 1px solid #e6decd; \n border-radius: 4px; \n padding: 8px 14px; \n font-size: 13px; \n outline: none; \n transition: all 0.2s ease-in-out; \n background: #fffdf5;\n font-family: 'Roboto', sans-serif;\n }\n .theme-input:focus { \n border-color: #008DDA; \n box-shadow: 0 0 0 3px rgba(0, 141, 218, 0.15); \n background: white;\n }\n "})]})}},6210(e,t,a){a.d(t,{A:()=>s});const s=(0,a(7784).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])}}]); 3//# sourceMappingURL=4953.5bfe68d9.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.