1(this.webpackJsonpbrightics_ai=this.webpackJsonpbrightics_ai||[]).push([[78],{1147:function(e,t,n){},1212:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return x}));var i=n(635),c=n(0),l=n(48),a=n(66),s=n(1),r=n(599),o=n(45),d=n(52),u=n(90),m=n(629),b=n(265),j=n(630),O=n(264),v=n(23),h=n(10),f=(n(1147),n(2));function x(){var e=Object(r.a)().t,t=Object(o.d)(),n=Object(d.i)().idBullentin,x=Object(s.useState)(!1),p=Object(a.a)(x,2),N=p[0],g=p[1],y=Object(s.useState)(0),T=Object(a.a)(y,2),L=T[0],C=T[1],S=Object(s.useState)(0),B=Object(a.a)(S,2),w=B[0],M=B[1],k=Object(s.useState)(0),A=Object(a.a)(k,2),R=A[0],W=A[1],E=Object(d.g)(),I=Object(d.h)(),z=Object(s.useState)([{}]),D=Object(a.a)(z,2),P=D[0],F=D[1],G=Object(o.e)((function(e){return e.forumReducer.bullentinList})),_=Object(s.useState)(""),q=Object(a.a)(_,2),J=q[0],K=q[1],U=Object(s.useState)(""),V=Object(a.a)(U,2),H=V[0],Q=V[1],X=Object(s.useState)({id:-1,index:-1}),Y=Object(a.a)(X,2),Z=Y[0],$=Y[1];Object(s.useEffect)((function(){n&&C(Number(n)),Object(h.N)("contents")}),[I]);var ee=m.e().shape({bullentinTitle:m.g().trim().required("".concat(e("community.enterBullentinBoard"))),tagList:m.a().min(1,"".concat(e("community.addTag"))).required("".concat(e("community.addTag")))}),te=Object(j.a)({onSubmit:function(){var e=pe(Object(l.a)(P)),n=[{id:0!==L?w:void 0,menuName:se.bullentinTitle,categories:(null===G||void 0===G?void 0:G.length)>0?se.tagList.concat(xe(Object(l.a)(se.tagList))):Object(l.a)(se.tagList),grantAccessTo:fe(Object(l.a)(se.accessList)),sortOrder:e.sortOrder}],i={id:0!==L?w:void 0,updatedOrder:0===L||e.numberOrderOld!==e.numberOrderNew,forumBulletinBoardMenus:n.concat(e.array)};t(0===L?Object(v.S)(i):Object(v.W)(i))},enableReinitialize:!0,initialValues:{bullentinTitle:"",bullentinSelected:0,contents:"",tagList:[{}],accessList:[]},validationSchema:ee}),ne=te.handleSubmit,ie=te.handleChange,ce=te.setFieldValue,le=te.validateForm,ae=te.touched,se=te.values,re=ae.bullentinTitle?te.errors:{};Object(s.useEffect)((function(){le().then((function(e){re=Object(c.a)({},e)}))}),[e]),Object(s.useEffect)((function(){if((null===G||void 0===G?void 0:G.length)>0){var e=[];for(var t in G)e.push({id:G[t].id,name:G[t].menuName,menuName:G[t].menuName});if(F(e),0!==L){var n,i,c=G.findIndex((function(e){return e.id===L}));if(c<0)return E.push("/community/community-forum-list");oe(null===(n=G[c])||void 0===n?void 0:n.grantAccessTo),be(L),M(L),W(L),ce("bullentinSelected",L),me("bullentinTitle",null===(i=G[c])||void 0===i?void 0:i.menuName),$({id:-1,index:-1})}else ce("tagList",[])}else F([]),ce("tagList",[])}),[G]),Object(s.useEffect)((function(){return t(Object(v.N)()),function(){t(Object(v.z)())}}),[]);var oe=function(e){if(""!==e){var t=e.split(","),n=[];for(var i in t)n.push({id:i,name:t[i]});ce("accessList",n)}else ce("accessList",[])},de=function(e){var t=P.findIndex((function(e){return e.id===w}));t<0?e.push({id:0,menuName:se.bullentinTitle.trim()}):e[t].menuName=se.bullentinTitle.trim(),F(e)},ue=function(e){var t=P.findIndex((function(e){return e.id===w}));if(R!==w){var n=P.findIndex((function(e){return e.id===R}));e[n].menuName=e[n].name,W(w)}else t>=0&&(e[t].menuName=se.bullentinTitle.trim());F(e)};Object(s.useEffect)((function(){!function(){var e;""!==(null===se||void 0===se||null===(e=se.bullentinTitle)||void 0===e?void 0:e.replace(/\s/g,""))&&(0===L?de(Object(l.a)(P)):ue(Object(l.a)(P)))}()}),[se.bullentinTitle]);var me=function(e,t){var n=G.find((function(e){return e.id===t}));ce(e,t),n&&(M(t),ce("bullentinTitle",n.menuName),ce("tagList",n.categories),oe(n.grantAccessTo))},be=function(e){var t,n,c,l=null!==(t=null===(n=G.find((function(t){return t.id===e})))||void 0===n?void 0:n.categories)&&void 0!==t?t:[],a=Object(i.a)(l);try{for(a.s();!(c=a.n()).done;){var s=c.value;s.name=s.categoryName}}catch(r){a.e(r)}finally{a.f()}ce("tagList",l)},je=function(){var e,t=Object(l.a)(se.tagList),n=null;0!==Object.keys(null!==(e=t[0])&&void 0!==e?e:[]).length&&(n=t.find((function(e){var t;return(null===e||void 0===e||null===(t=e.categoryName)||void 0===t?void 0:t.toLowerCase())===J.trim().toLowerCase()}))),n||""===J.replace(/\s/g,"")||(t.push({categoryName:J.trim()}),ce("tagList",t),K(""))},Oe=function(){var e=Object(l.a)(se.accessList);e.find((function(e){return e.name.toLowerCase()===H.trim().toLowerCase()}))||""===H.replace(/\s/g,"")||!0!==Object(h.i)(H.replace(/\s/g,""))?g(!0):(e.push({name:H.trim()}),ce("accessList",e),Q(""),g(!1))},ve=function(e){Z.index>=0&&(0!==Z.index&&"minus"===e?he(Z.index,Z.index-1):Z.index+1!==(null===P||void 0===P?void 0:P.length)&&"plus"===e&&he(Z.index,Z.index+1))},he=function(e,t){var n=Object(l.a)(P);if(t>=n.length)for(var i=t-n.length+1;i--;)n.push();n.splice(t,0,n.splice(e,1)[0]),F(n),$(Object(c.a)(Object(c.a)({},Z),{},{index:t}))},fe=function(e){var t="";for(var n in e)t+="".concat(e[n].name,",");return t.slice(0,-1)},xe=function(e){var t,n,i=null!==(t=null===(n=G.find((function(e){return e.id===w})))||void 0===n?void 0:n.categories)&&void 0!==t?t:[],c=[],l=function(t){e.findIndex((function(e){return e.id===i[t].id}))<0&&c.push({id:i[t].id,categoryName:i[t].categoryName,deleted:!0}
1)};for(var a in i)l(a);return c},pe=function(e){var t="",n="";for(var i in G){var c;t+=null===(c=G[i])||void 0===c?void 0:c.id.toString()}for(var l in e)e[l].sortOrder=Number(l)+1,n+=e[l].id.toString();var a=e.findIndex((function(e){return e.id===w})),s={sortOrder:e[a].sortOrder,array:e,numberOrderOld:t,numberOrderNew:n};return e.splice(a,1),s},Ne=Object(s.useMemo)((function(){var t;return null===(t=se.accessList)||void 0===t?void 0:t.map((function(t,n){return Object(f.jsxs)("li",{className:"list",children:[t.name,Object(f.jsx)("button",{type:"button",className:"btnDelList",style:{border:"none"},onClick:function(){!function(e,t){var n=Object(l.a)(se.accessList);n.splice(t,1),ce("accessList",n)}(t.id,n)},children:e("community.Delete")})]},"access_"+t.id)}))}),[se.accessList]),ge=Object(s.useMemo)((function(){var e,t;if(0!==Object.keys(null!==(e=se.tagList[0])&&void 0!==e?e:[]).length)return null===(t=se.tagList)||void 0===t?void 0:t.map((function(e,t){return Object(f.jsxs)("div",{className:"boxRelative badge02 bgGray04 mR6 categoryItem",children:[" ",e.categoryName,Object(f.jsx)("button",{type:"button",onClick:function(){!function(e){var t=Object(l.a)(se.tagList);t.splice(e,1),ce("tagList",t)}(t)},className:"btnBadgeDelete pointer",children:"Delete"})]},"tag_"+e.categoryName)}))}),[se.tagList]),ye=Object(s.useMemo)((function(){return null===P||void 0===P?void 0:P.map((function(e,t){return Object(f.jsxs)("li",{className:"".concat(Z.id===e.id?"on":""),onClick:function(){!function(e,t){$(Object(c.a)(Object(c.a)({},Z),{},{id:e,index:t}))}(e.id,t)},children:[" ",e.menuName]},"bul_"+e.id)}))}),[P,Z]);return Object(f.jsx)(f.Fragment,{children:Object(f.jsx)("div",{className:"contW",children:Object(f.jsx)("main",{role:"main",id:"contents",className:"mainContW bgGray02 pB80",children:Object(f.jsx)("form",{children:Object(f.jsxs)("section",{className:"container boxRelative mT60",children:[Object(f.jsx)("div",{className:"locationW",children:Object(f.jsxs)("ul",{className:"location",children:[Object(f.jsx)("li",{children:Object(f.jsx)(u.a,{to:"/",className:"txtGray01",children:"Home >\xa0"})}),Object(f.jsx)("li",{children:"Community >\xa0"}),Object(f.jsx)("li",{children:e("community.Forum")})]})}),Object(f.jsx)("h3",{className:"tit01",children:e(0!==L?"community.EditBulletinBoardMenu":"community.AddBulletinBoardMenu")}),Object(f.jsxs)("div",{className:"contBox01 mT25 pL80 pR80",children:[Object(f.jsx)("div",{className:"tit02",children:e("community.BulletinBoardInformation")}),Object(f.jsx)("hr",{className:"line01 mT10"}),Object(f.jsxs)("div",{className:"tblW mT30 pL139 pR139 fs14",children:[0!==L&&Object(f.jsxs)("div",{className:"tblRow",children:[Object(f.jsx)("div",{className:"tblCell width200 txtMedium",children:e("community.BulletinClassification")}),Object(f.jsx)("div",{className:"tblCell",children:Object(f.jsx)("div",{className:"selectW",children:Object(f.jsx)(b.a,{libSelect:P,itemSelected:se.bullentinSelected,name:"bullentinSelected",handleChange:me,disabledFunction:!1,classWrap:"sliderSelect01 select01 widthP100",error:re.bullentinSelected})})})]}),Object(f.jsxs)("div",{className:"tblRow",children:[Object(f.jsxs)("div",{className:"tblCell pT24 width200 txtMedium",children:[e("community.BulletinBoard"),Object(f.jsx)("span",{className:"txtRed",children:"*"})]}),Object(f.jsx)("div",{className:"tblCell pT24",children:Object(f.jsxs)("div",{className:"".concat(re.bullentinTitle?"error":""," inputW"),children:[Object(f.jsx)("div",{className:"inputTxt",children:Object(f.jsx)("input",{type:"text",id:"inputGuide01",className:"inputData hiddenPlaceholder",name:"bullentinTitle",placeholder:e("community.enterBullentinBoard"),value:se.bullentinTitle,onChange:ie,autoComplete:"off"})}),re.bullentinTitle?Object(f.jsx)("p",{className:"errorMsg",children:re.bullentinTitle}):null]})})]}),Object(f.jsxs)("div",{className:"tblRow",children:[Object(f.jsxs)("div",{className:"tblCell pT30 width200 txtMedium vAlignT",children:[e("community.Tag"),Object(f.jsx)("span",{className:"txtRed",children:"*"})]}),Object(f.jsxs)("div",{className:"tblCell pT24",children:[Object(f.jsxs)("div",{children:[Object(f.jsxs)("div",{className:"".concat(re.tagList?"error":""," inputW disInBlock vAlignMiddle"),style:{width:"266px"},children:[Object(f.jsx)("div",{className:"inputTxt",children:Object(f.jsx)("input",{autoComplete:"off",type:"text",id:"",className:"inputData hiddenPlaceholder",placeholder:e("community.EnterCategoryName"),value:J,onChange:function(e){K(e.target.value)},onKeyPress:function(e){"Enter"===e.key&&je()}})}),re.tagList?Object(f.jsx)("p",{className:"errorMsg",children:re.tagList}):null," "]}),Object(f.jsx)("button",{type:"button",className:"btnPrimary btnSize03 mL8 minW80",onClick:function(){je()},children:e("community.Add")})]}),Object(f.jsx)("div",{className:"badgeList mT8",children:ge})]})]}),Object(f.jsxs)("div",{className:"tblRow",children:[Object(f.jsx)("div",{className:"tblCell pT24 width200 txtMedium vAlignT",children:e("community.BulletinboardOrder")}),Object(f.jsx)("div",{className:"tblCell pT24",children:Object(f.jsxs)("div",{className:"notiSequence",children:[Object(f.jsx)("ul",{children:ye}),Object(f.jsxs)("div",{className:"btnMove",children:[Object(f.jsx)("button",{type:"button",className:"btnMoveUp",onClick:function(){ve("minus")},children:e("community.Upload")}),Object(f.jsx)("br",{}),Object(f.jsx)("button",{type:"button",className:"btnMoveDown",onClick:function(){ve("plus")},children:e("community.GetOff")})]})]})})]}),Object(f.jsxs)("div",{className:"tblRow",children:[Object(f.jsx)("div",{className:"tblCell pT30 width200 txtMedium vAlignT",children:e("community.Authorization")}),Object(f.jsxs)("div",{className:"tblCell pT24",children:[Object(f.jsxs)("div",{className:"inputW disInBlock vAlignMiddle heightAuto",style:{width:"535px"},children:[Object(f.jsx)("div",{className:"inputTxt ".concat(N?"errorEmail"
1:""),children:Object(f.jsx)("input",{type:"text",autoComplete:"off",className:"inputData",placeholder:e("community.EnterEmail"),value:H,onChange:function(e){Q(e.target.value)},onKeyPress:function(e){"Enter"===e.key&&Oe()},onBlur:function(){g(!1)}})}),Object(f.jsx)("div",{className:"listType02",children:Object(f.jsx)("ul",{className:"".concat(se.accessList.length>0?"selectList scrollbar":""),children:Ne})}),N?Object(f.jsx)("p",{className:"errorMsg",children:e("home.emailInvalid")}):null]}),Object(f.jsx)("button",{type:"button",className:"btnPrimary btnSize03 mL8 minW80 vAlignTop",onClick:function(){Oe()},children:e("home.ConFirm")})]})]}),Object(f.jsxs)("div",{className:"tblRow",children:[Object(f.jsx)("div",{className:"tblCell pT30 width200 txtMedium vAlignT"}),Object(f.jsx)("div",{className:"tblCell pT24",children:Object(f.jsx)("p",{children:e("community.messageAuthorization")})})]})]})]}),Object(f.jsx)("div",{className:"clearfix mT24",children:Object(f.jsxs)("div",{className:"floatR",children:[Object(f.jsx)("button",{type:"button",className:"btnSecond02 btnSize01",onClick:function(){Object(O.a)({title:"".concat(e("dialog.confirm")),body:"".concat(e("resources.alertWarningSave"))}).then((function(){E.push("/community/community-forum-list")}),(function(){}))},children:e("community.Cancel")}),0!==L&&Object(f.jsx)("button",{type:"button",className:"btnPrimary btnSize01 mL8",onClick:function(){Object(O.a)({title:"".concat(e("dialog.confirm")),body:"".concat(e("community.deleteBullentinBoard"))}).then((function(){t(Object(v.F)(w))}),(function(){}))},children:e("community.Delete")}),Object(f.jsx)("button",{type:"button",className:"btnPrimary btnSize01 mL8",onClick:function(){ne()},children:e(0!==L?"partners.Save":"partners.Add")})]})})]})})})})})}}}]);
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.