1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7683],{34981:function(e,l,a){var t=a(68267),r=a(76744),s=t(function(e,l,a){return e+(a?" ":"")+r(l)});e.exports=s},36488:function(e,l,a){"use strict";a.d(l,{g:function(){return A}});var t=a(24246),r=a(27378),s=a(78113),n=a(356),i=a(58278),c=a(80929),o=a(24843),d=a(8207),u=a(54410),m=a(92739),p=a(76177),x=a.n(p),h=a(23726),j=a(38978),b=a(71292),g=a(96604);let f=e=>{let{image:l,onDelete:a,onMoveUp:s,onMoveDown:d}=e,[u,p]=(0,r.useState)("");(0,r.useEffect)(()=>{p(URL.createObjectURL(l))},[l,p]);let h=(0,r.useCallback)(()=>URL.revokeObjectURL(u),[u]);return(0,t.jsxs)(n.Z,{className:x().imageFilePreviewWrap,children:[(0,t.jsx)(i.x,{className:x().imageFilePreviewImgWrap,children:(0,t.jsx)(c.E,{src:u,className:x().imageFilePreviewImg,onLoad:h})}),(0,t.jsx)(i.x,{className:x().imageFilePreviewName,children:l.name}),(0,t.jsxs)(o.A.Group,{children:[s?(0,t.jsx)(o.A,{onClick:()=>s?.(l),disabled:!s,variant:"default",children:(0,t.jsx)(m.G,{icon:g.FPD})}):null,d?(0,t.jsx)(o.A,{onClick:()=>d?.(l),disabled:!d,variant:"default",children:(0,t.jsx)(m.G,{icon:g.r5q})}):null,(0,t.jsx)(o.A,{onClick:()=>a?.(l),color:"red",children:(0,t.jsx)(m.G,{icon:g.XAH})})]})]})},v=e=>{let l,a,{image:r,onDelete:s,onMoveUp:d,onMoveDown:u}=e;return r.type!==j.w_.IMAGE?(l=r.data?.thumbUrl,a=r.data?.title||r.data?.caption||r.data?.url):(l=r.data?.url,a=r.data?.file?.name||""),(0,t.jsxs)(n.Z,{className:x().imageFilePreviewWrap,children:[(0,t.jsx)(i.x,{className:x().imageFilePreviewImgWrap,children:(0,t.jsx)(c.E,{src:l,className:x().imageFilePreviewImg})}),(0,t.jsx)(i.x,{className:x().imageFilePreviewName,children:a}),(0,t.jsxs)(o.A.Group,{children:[d?(0,t.jsx)(o.A,{onClick:()=>d?.(r),disabled:!d,variant:"default",children:(0,t.jsx)(m.G,{icon:g.FPD})}):null,u?(0,t.jsx)(o.A,{onClick:()=>u?.(r),disabled:!u,variant:"default",children:(0,t.jsx)(m.G,{icon:g.r5q})}):null,(0,t.jsx)(o.A,{onClick:()=>s?.(r),color:"red",children:(0,t.jsx)(m.G,{icon:g.XAH})})]})]})},A=e=>
1{let{className:l,label:a,maxFileCount:i=1,name:c}=e,[{value:o},{touched:p,error:x},{setTouched:A,setValue:y}]=(0,b.U$)(c),C=(0,h.N)("Forms.imageUpload"),P=(0,r.useCallback)(e=>{y(i>1?[...o&&Array.isArray(o)?o:[],...e||[]]:e[0],!0),A(!0,!1)},[i,o,y,A]),_=(0,r.useCallback)(e=>"file-invalid-type"===e[0].code?alert(C("errors.invalidType",{types:Object.values(j.LO.IMAGE).map(e=>e.replace(/^image\//,"").join(", "))})):alert(C("errors.default",{size:`${j.md}MB`,count:i})),[i,C]),w=(0,r.useCallback)(e=>{i>1?y((o||[]).filter(l=>l!==e)):y(null)},[i,o,y]),O=(0,r.useCallback)(e=>{if(!o||!Array.isArray(o))return;let l=o.indexOf(e);if(l<=0)return;let a=o[l-1],t=o.slice();t[l-1]=e,t[l]=a,y(t),A(!0,!1)},[o,y,A]),k=(0,r.useCallback)(e=>{if(!o||!Array.isArray(o))return;let l=o.indexOf(e);if(l<0||l>=o.length-1)return;let a=o[l+1],t=o.slice();t[l+1]=e,t[l]=a,y(t),A(!0,!1)},[o,y,A]),R=1===i&&o?[o]:o||[];return(0,t.jsxs)(d.K,{gap:0,children:[a?(0,t.jsx)(u.x,{component:"label",tt:"uppercase",fw:"bold",size:"0.85rem",htmlFor:c,mt:"xs",mb:"5px",children:a}):null,(0,t.jsx)(s.fh,{accept:Object.values(j.LO.IMAGE),className:l,onDrop:P,onReject:_,maxSize:j.kd,maxFiles:i,children:(0,t.jsxs)(n.Z,{gap:"md",justify:"center",children:[(0,t.jsx)(s.fh.Accept,{children:(0,t.jsx)(m.G,{icon:g.cf$,size:"2x"})}),(0,t.jsx)(s.fh.Reject,{children:(0,t.jsx)(m.G,{icon:g.EOp,size:"2x"})}),(0,t.jsx)(s.fh.Idle,{children:(0,t.jsx)(m.G,{icon:g.VmB,size:"2x"})}),(0,t.jsx)(u.x,{children:C("prompt",{count:i})})]})}),p&&x?(0,t.jsx)(u.x,{c:"red",fz:"sm",children:x}):null,(0,t.jsx)(d.K,{gap:"xs",mt:"sm",children:R?.length?R.map((e,l)=>{let a={key:`${e.type}_${e.data?.url||e.data?.thumbUrl}`,image:e,onDelete:w,onMoveDown:i>1&&R?.length>1&&l<R?.length-1?k:null,onMoveUp:i>1&&R?.length>1&&l>0?O:null};return e instanceof File?(0,t.jsx)(f,{...a}):(0,t.jsx)(v,{...a})}):null})]})}},23133:function(e,l,a){"use strict";a.d(l,{A:function(){return n}});var t=a(24246),r=a(80310),s=a(71292);let n=e=>{let{className:l,name:a,hint:n,label:i,placeholder:c,options:o=[],required:d=!1}=e,[u,m]=(0,s.U$)(a),p=o.map(e=>"string"==typeof e?{label:`${e.charAt(0).toUpperCase()}${e.slice(1)}`,value:e}:e);return c?.length&&p.unshift({label:c,value:"",disabled:!0}),(0,t.jsx)(r.p,{className:l,data:p,description:n,label:i,name:a,required:d,size:"md",...u,error:m.error&&m.touched?m.error:void 0})}},9276:function(e,l,a){"use strict";a.d(l,{Q:function(){return o}});var t=a(24246),r=a(17798),s=a(27378),n=a(23615),i=a.n(n),c=a(71292);let o=e=>{let{className:l,hint:a,label:n,name:i,placeholder:o="Add keywords here",required:d,size:u="md"}=e,[,m,{setTouched:p,setValue:x}]=(0,c.U$)(i),h=(0,s.useCallback)(e=>{p(!0,!1),x(e,!0)},[p,x]);return(0,t.jsx)(r.B,{clearable:!0,className:l,label:n,name:i,description:a,onChange:h,placeholder:o,required:d,error:m.touched&&m.error?m.error:void 0,size:u})};o.propTypes={name:i().string.isRequired,placeholder:i().string,className:i().string}},37683:function(e,l,a){"use strict";var t=a(24246),r=a(27378),s=a(86677),n=a(51906),i=a(58278),c=a(10576),o=a(71292),d=a(68301),u=a(34981),m=a.n(u),p=a(44221),x=a(98985),h=a(99602),j=a(38978),b=a(1666),g=a(29860),f=a(70104),v=a(23133),A=a(80339),y=a(36488),C=a(85552),P=a(71949),_=a(9276);let w=d.Ry().shape({allow_replies:d.Z_().oneOf(["false","true"]).required(),admin_tags:d.IX(d.Z_().oneOf([...Object.values(j.GB),...Object.values(j.qb)]).required()),content:d.Ry().nullable(),excerpt:d.Ry().shape({media:(0,b.DL)().required("Please provide a Post Image"),text:d.Z_().required("Please provide a Post Excerpt")}).required("Please provide a Post Excerpt"),name:d.Z_().test("no-leading-slash","Slug must not start with a slash",e=>!e?.length||!e.startsWith("/")),status:d.Z_().oneOf(Object.values(j.nn)).required(),tags:d.IX(d.Z_().required()).required("Please provide at least one tag"),title:d.Z_().min(10,"Title must be at least 10 characters").required("Please provide a Title"),type:d.Z_().oneOf([j.A2.ARTICLE,j.A2.TUTORIAL]).required()});l.Z=e=>{let{post:l}=e,{subscribeToPost:a,user:d}=(0,p.a)(),[u,b]=(0,r.useState)(null),O=(0,s.useRouter)(),k=async(e,t)=>{let r;if(b(null),(0,x.mV)(e.content)){t.setFieldError("content",`Post content is below the minimum length (${j.Sp} characters). Please add some more content to your post.`),t.setSubmitting(!1);return}try{r=await (0,x.K1)(e,d,l)}catch(e){b((0,h.rY)(e)),t.setSubmitting(!1);return}l||await a(r.body._id);let s=encodeURIComponent((0,h.h0)(r.body.type)),n=encodeURIComponent(r.body.name);O.push(`/${s}/${n}`)};return(0,t.jsx)(o.J9,{initialValues:{allow_replies:l?.allow_replies===void 0?"true":l.allow_replies?"true":"false",admin_tags:l?.admin_tags||[],content:l?.content,excerpt:{media:l?.excerpt?.media||null,text:l?.excerpt?.text||""},name:l?.name||"",status:l?.status||j.nn.DRAFT,tags:l?.tags||[],title:l?.title||"",type:l?.type||j.A2.ARTICLE},onSubmit:k,validationSchema:w,children:e=>{let{values:a}=e;return(0,t.jsxs)(o.l0,{children:[u&&(0,t.jsx)(C.Z,{error:u}),(0,t.jsxs)(n.r,{mb:"lg",gutter:"xl",children:[(0,t.jsxs)(n.r.Col,{span:{base:12,md:3},children:[(0,t.jsx)(v.A,{name:"type",label:"Post Type",options:[j.A2.ARTICLE,j.A2.TUTORIAL],placeholder:""}),(0,t.jsx)(v.A,{name:"status",label:"Status",options:Object.values(j.nn),placeholder:""}
1),(0,t.jsx)(v.A,{name:"allow_replies",label:"Replies",options:[{label:"Open",value:"true"},{label:"Closed",value:"false"}],placeholder:""}),(0,t.jsx)(f.e,{name:"admin_tags",label:"Admin Tags",options:a.type===j.A2.ARTICLE?Object.values(j.GB).map(e=>({value:e,label:m()(e)})):Object.values(j.qb).map(e=>({value:e,label:m()(e)}))})]}),(0,t.jsxs)(n.r.Col,{span:{base:12,md:9},children:[(0,t.jsx)(g.Xn,{name:"title",required:!0,label:"Post Title"}),(0,t.jsx)(g.Xn,{name:"name",label:"Post Slug",placeholder:"Slug (auto-generated if not set)"}),(0,t.jsxs)(n.r,{children:[(0,t.jsx)(n.r.Col,{span:{base:12,md:6},children:(0,t.jsx)(y.g,{name:"excerpt.media",label:"Featured Image",maxFileCount:1})}),(0,t.jsx)(n.r.Col,{span:{base:12,md:6},children:(0,t.jsx)(g.ld,{name:"excerpt.text",label:"Post Excerpt"})})]}),(0,t.jsx)(i.x,{mt:"sm",children:(0,t.jsx)(_.Q,{name:"tags",label:"Tags",placeholder:"Type a tag and press Enter"})}),(0,t.jsx)(c.i,{my:"lg"}),(0,t.jsx)(P.L,{label:"Post Content",name:"content",required:!0}),(0,t.jsx)(A.d,{label:l?"Save Post":"Create Post"})]})]})]})}})}}}]);
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.