PageSourceSearch

https://www.app.napoleoncat.com/r/static/js/host.5814.55649fcc09ef39e636a4.chunk.js

js napoleoncat.com collected 2026-09-24 15:29:16 UTC 72,417 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunknapoleon=globalThis.webpackChunknapoleon||[]).push([[5814],{4401:(Ze,pe,c)=>{c.d(pe,{n$:()=>T});var e=c(65723),g=c(81924),y=c(85067),t=c(30395),M=c.n(t),Ae=c(70583);const j={saveButtons:"cY3emn_Y2QyMYzYwY1Ua",saveWarningTooltip:"E39vlZZ4sBIUSokHLFYi"};var G=(L,k,te)=>new Promise((ue,K)=>{var H=U=>{try{w(te.next(U))}catch(de){K(de)}},oe=U=>{try{w(te.throw(U))}catch(de){K(de)}},w=U=>U.done?ue(U.value):Promise.resolve(U.value).then(H,oe);w((te=te.apply(L,k)).next())});const T=({onCancelClick:L,onSaveClick:k,onSaveAndRunClick:te,warningTooltipTranslationKey:ue,disableSave:K,className:H})=>{const oe=(0,y.useTranslationCategory)(y.ETranslationCategories.autoModeration),w=(0,g.useRef)(null),U=(0,g.useRef)(null),[de,ve]=(0,g.useState)(""),se=oe.AM_RULE_EDITOR_BUTTON_SAVE,Ie=oe.AM_RULE_EDITOR_BUTTON_SAVE_AND_RUN,ge=oe.AM_RULE_EDITOR_BUTTON_CANCEL,Z=fe=>()=>G(void 0,null,function*(){fe==="saveAndRun"&&(ve("saveAndRun"),te()),fe==="save"&&(ve("save"),k())}),ae=()=>{if(!ue)return null;const fe=de==="save"?w:U,be=de==="save"?y.EFloatingUIPlacements.Bottom:y.EFloatingUIPlacements.BottomEnd;return(0,e.jsx)(Ae.A,{triggerRef:fe,classNames:j.saveWarningTooltip,placement:be,children:(0,e.jsx)(y.TranslatedMessage,{withHTML:!0,translationKey:ue,category:y.ETranslationCategories.autoModeration})})};return(0,e.jsxs)("div",{className:M()(j.saveButtons,H),children:[(0,e.jsx)(y.Button,{size:y.EButtonSizes.Medium,onClick:L,theme:y.EButtonThemes.Ghost,testId:"automoderation-creator-cancel-button",children:ge}),(0,e.jsx)(y.Button,{ref:w,size:y.EButtonSizes.Medium,theme:y.EButtonThemes.Gray,onClick:Z("save"),disabled:K,testId:"automoderation-creator-draft-button",children:se}),ae(),(0,e.jsx)(y.Button,{ref:U,size:y.EButtonSizes.Medium,onClick:Z("saveAndRun"),theme:y.EButtonThemes.Primary,disabled:K,testId:"automoderation-creator-submit-button",children:Ie})]})};var E=c(79854),Le=c(66525)},25138:(Ze,pe,c)=>{c.d(pe,{C0:()=>kn,tq:()=>ns,Z3:()=>Wn,XE:()=>Qn,cr:()=>$n,VK:()=>qn,IM:()=>Vn,LC:()=>hn});var e=c(65723),g=c(81924),y=c.n(g),t=c(85067),M=c(61636),Ae=c(12046),j=c.n(Ae),G=c(62598),T=c(60585),E=c(96181),Le=c(39752),L=c(39210),k=c(87531),te=c(54731),ue=c(13744),K=c(30395),H=c.n(K),oe=c(67918),w=c(78483),U=c(18761),de=c(30632);const ve={continueButton:"SxZ0LDJuUzAswLkiiF0w"},se=({onClick:o,disabled:n})=>{const s=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_BOX_CONTINUE_BUTTON");return(0,e.jsx)(t.Button,{classNames:ve.continueButton,disabled:n,onClick:o,theme:t.EButtonThemes.Ghost,size:t.EButtonSizes.Medium,fullWidth:!1,testId:"automoderation-box-continue-button",children:s})},Ie={assignToModerator:"RoAATJjAgrjc0_1RmA1t",placeholder:"lH3HJSNG3jvkkTzvhqli",chooseModerator:"LJAE4Xsl5TVdOXV4qoB_",confirm:"Fujx4c1CTREpPvBvSp4A",selectedActionItem:"BYr1CgRr_SmAGlz8kVPB"},ge=({name:o,onSubmit:n,options:s,autoSave:a,control:i,disableContinue:d})=>{const r=t.ETranslationCategories.autoModeration,m=(0,t.useTranslation)(r,"AM_BOX_NAPOLEON_CAT_ACTIONS_ASSIGN_MODERATOR_CHOOSE"),l=(0,t.useTranslation)(r,"AM_BOX_NAPOLEON_CAT_ACTIONS_ASSIGN_SELECT_PLACEHOLDER");return(0,e.jsxs)("div",{className:Ie.assignToModerator,children:[(0,e.jsx)("div",{className:Ie.chooseModerator,children:m}),(0,e.jsx)(de.k,{control:i,placeholder:l,name:o,options:s,required:!0}),!a&&(0,e.jsx)("div",{className:Ie.confirm,children:(0,e.jsx)(se,{disabled:d,onClick:n})})]})};var Z=c(12684);const ae={multiTag:"_5MEKLjvw7BbBjpBvQa1g",content:"K5uZXR0ylTLVJAmEGXS6",inputTitle:"dFR7EP2UAZTpLI6kze13"},fe=({name:o,onSubmit:n,autoSave:s,control:a,disableContinue:i})=>{const{data:d}=(0,t.useGetProjectTagsQueryState)(),r=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_BOX_NAPOLEON_CAT_ACTIONS_MULTI_TAG_PLACEHOLDER"),m=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_BOX_NAPOLEON_CAT_ACTIONS_MULTI_TAG_INPUT_TITLE");return(0,e.jsxs)("div",{className:ae.multiTag,children:[(0,e.jsxs)("div",{className:ae.content,children:[(0,e.jsx)("div",{className:ae.inputTitle,children:m}),(0,e.jsx)(Z.TagsSelectWithForm,{required:!0,control:a,name:o,tags:d?.interaction||[],placeholder:r,limit:10})]}),!s&&(0,e.jsx)(se,{onClick:n,disabled:i})]})};var be=c(96257),$=c(70583),D=c(91718),J=c(28952),De=c(7110);const Se={optionsList:"UOPOKpBbdy9NJXrLniPK"},ye=[{value:t.ESentiments.positive,kind:"positive"},{value:t.ESentiments.negative,kind:"negative"},{value:t.ESentiments.neutral,kind:"neutral"}],we=({selectedValue:o,onChange:n,labelByValue:s,kindByValue:a})=>{const{close:i}=D.Popover.usePopover(),d=r=>{n(r),i()};return(0,e.jsx)("div",{className:Se.optionsList,children:ye.map(({value:r})=>(0,e.jsx)(D.SentimentOption,{kind:a[r],label:s[r],selected:o===r,onClick:()=>d(r)},r))})},ie={trigger:"GsP9JHy6zVUzMLu3D493",triggerOpen:"NmwLfNANYtbr_PbbCD8t",triggerDisabled:"CyFxUfztQ6XysdFooBjV",triggerError:"mrGoo2cywEOV6xbcUYBi",triggerContent:"dIoOp814a8NLOk2LZINM",triggerValue:"L2BPAsVjoB7eHxXr7ZdC",triggerValueLabel:"FBc1Do_EyU0z9FwEKnSs",triggerPlaceholder:"kML7H3LgT2C8Hjf21Nb1",triggerIndicators:"wyJNblzmKvlfgUSCNq93",triggerClear:"obmBx
1IdPS8ynOgYI3iIy"},Ue=({value:o,placeholderText:n,disabled:s,hasError:a,isClearable:i,onClear:d,kindByValue:r,labelByValue:m,triggerRef:l,onBlur:u})=>{const{isOpen:h}=D.Popover.usePopover();return(0,e.jsxs)("button",{type:"button",ref:l,disabled:s,onBlur:u,className:(0,D.cn)(ie.trigger,{[ie.triggerOpen]:h,[ie.triggerDisabled]:s,[ie.triggerError]:a}),children:[(0,e.jsx)("span",{className:ie.triggerContent,children:o?(0,e.jsxs)("span",{className:(0,D.cn)("tailwind-scope",ie.triggerValue),children:[(0,e.jsx)(D.SentimentIcon,{kind:r[o]}),(0,e.jsx)("span",{className:ie.triggerValueLabel,children:m[o]})]}):(0,e.jsxs)("span",{className:ie.triggerPlaceholder,children:[(0,e.jsx)(t.Icon,{name:t.EIconNames.Sentiment,size:t.EIconSizes.size14,color:t.EIconColors.Grey}),(0,e.jsx)("span",{children:n})]})}),(0,e.jsxs)("span",{className:ie.triggerIndicators,children:[i&&o&&!s&&(0,e.jsx)("span",{role:"button",tabIndex:-1,"aria-label":"clear",className:ie.triggerClear,onClick:p=>{p.stopPropagation(),d()},children:(0,e.jsx)(t.Icon,{name:t.EIconNames.Close,size:t.EIconSizes.size12,color:t.EIconColors.Grey})}),(0,e.jsx)(t.Icon,{name:t.EIconNames.ArrowExpanded,size:t.EIconSizes.size12,color:t.EIconColors.Grey})]})]})},xe={sentimentSelect:"ka2DMXK8gBRX34WySJGR",stretch:"kMClqFIeZb0N_sAl54gS",chooseSentiment:"axG1oNgXxaviitIfGBE7",confirm:"cbE9ItwtBS_57mzkdozc"},We=({name:o,title:n,placeholder:s,onSave:a,autoSave:i,required:d,control:r,disableContinue:m,stretch:l,isClearable:u,disabled:h,revalidate:p})=>{const A=t.ETranslationCategories.autoModeration,x=t.ETranslationCategories.main,v=(0,t.useTranslation)(A,"AM_BOX_NAPOLEON_CAT_ACTIONS_SENTIMENT_CHOOSE_TITLE"),S=(0,t.useTranslation)(A,"AM_BOX_NAPOLEON_CAT_ACTIONS_SENTIMENT_PLACEHOLDER"),N=(0,t.useTranslation)(x,"SENTIMENT_POSITIVE"),O=(0,t.useTranslation)(x,"SENTIMENT_NEGATIVE"),R=(0,t.useTranslation)(x,"SENTIMENT_NEUTRAL"),I=(0,t.useTranslation)(A,"AM_AI_SENTIMENT_TOOLTIP"),_=(0,g.useRef)(null),[P,f]=(0,g.useState)(!1),W={[t.ESentiments.positive]:N,[t.ESentiments.negative]:O,[t.ESentiments.neutral]:R},X={[t.ESentiments.positive]:"positive",[t.ESentiments.negative]:"negative",[t.ESentiments.neutral]:"neutral"},le=()=>{typeof a=="function"&&a()};(0,g.useEffect)(()=>{!d&&typeof p=="function"&&p(o)},[d]),(0,g.useEffect)(()=>{let V;return P&&(V=window.setTimeout(()=>{f(!1)},2e3)),()=>clearTimeout(V)},[P]);const he=()=>{h&&f(!0)};return(0,e.jsxs)("div",{className:H()(xe.sentimentSelect,l&&xe.stretch),children:[(0,e.jsx)("div",{className:xe.chooseSentiment,children:n||v}),(0,e.jsx)(T.xI,{name:o,control:r,rules:{required:d?"FIELD_REQUIRED":!1},render:({field:V,fieldState:ne})=>{var z;const B=(0,e.jsx)("div",{ref:_,onClick:he,children:(0,e.jsx)(Ue,{value:V.value,placeholderText:s||S,disabled:h,hasError:!!ne.error,isClearable:u,onClear:()=>V.onChange(null),kindByValue:X,labelByValue:W,triggerRef:V.ref,onBlur:V.onBlur})});return(0,e.jsxs)(D.Popover.Root,{children:[h?B:(0,e.jsx)(D.Popover.Trigger,{children:B}),!h&&(0,e.jsx)(D.Popover.Content,{children:(0,e.jsx)(we,{selectedValue:V.value,onChange:V.onChange,labelByValue:W,kindByValue:X})}),((z=ne.error)==null?void 0:z.message)&&(0,e.jsx)(t.InputValidationErrors,{errors:ne.error.message}),P&&(0,e.jsx)($.A,{placement:t.EFloatingUIPlacements.BottomEnd,triggerRef:_,onHide:()=>f(!1),children:(0,e.jsx)("div",{dangerouslySetInnerHTML:{__html:be.A.sanitize(I,{ADD_ATTR:["target"]})}})})]})}}),!i&&(0,e.jsx)("div",{className:xe.confirm,children:(0,e.jsx)(se,{disabled:m,onClick:le})})]})};var at=c(40211),He=c(69338);const Ne={replyInputRow:"IGXJaD1wSYcUFNwi2X1w",inputWrapper:"YxRx8KYA1oCPlV1sOIBm",inputNo:"Y9vKhJAAUFlM5upRntST",emojiIcon:"U_Yyo7wBfMx9EdyqXMGy",deleteIcon:"RWpR563vYF2Grj3R1RXf",input:"YiiBy5o6aJvNhGlICUBr"},it=({order:o,name:n,withDeleteIcon:s=!1,onDelete:a,update:i,control:d,onBlur:r,maxLength:m})=>{const l=(0,T.FH)({control:d,name:n}),u=({native:h})=>{i(`${l}${h}`)};return(0,e.jsxs)("div",{className:Ne.replyInputRow,children:[(0,e.jsx)("div",{className:Ne.inputNo,children:o}),(0,e.jsxs)("div",{className:Ne.inputWrapper,children:[(0,e.jsx)(t.TextInputWithForm,{required:!0,control:d,name:n,classNames:Ne.input,onBlur:r,maxLength:m,dis
1playCounter:!0}),(0,e.jsx)("div",{className:Ne.emojiIcon,children:(0,e.jsx)(He.w,{onEmojiSelect:u,children:(0,e.jsx)(t.Icon,{name:t.EIconNames.SmileFace,size:t.EIconSizes.size24})})})]}),s&&(0,e.jsx)(t.Button,{theme:t.EButtonThemes.Wrapper,onClick:a,classNames:Ne.deleteIcon,children:(0,e.jsx)(t.Icon,{name:t.EIconNames.Delete,size:t.EIconSizes.size18})})]})},me={reply:"MjmPue9z5keBS5CwORqL",replies:"WhrEoMlMQ9R90n1ILj2r",repliesHeading:"rwrWm0qYDJb3Fs_DRIDQ",inputs:"EkpT6AbBFrqUlItlB0SK",input:"VydP4sCJ1t1KFrbd6MKC",addReplyWrapper:"bUWAuuq2Zpi3nVvhCp1G",addReply:"oz8Uyw8X47le6V1hXkY0",hint:"EHTbo_yPzEvuG23HvOCD",button:"jMEOYl_BXKS9MBpfm6H1",buttonOverride:"lqRD5GVe1OfjkM1x1pQZ"};var Ee=Object.defineProperty,Pe=Object.defineProperties,rt=Object.getOwnPropertyDescriptors,Et=Object.getOwnPropertySymbols,Tt=Object.prototype.hasOwnProperty,Ot=Object.prototype.propertyIsEnumerable,ht=(o,n,s)=>n in o?Ee(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,pt=(o,n)=>{for(var s in n||(n={}))Tt.call(n,s)&&ht(o,s,n[s]);if(Et)for(var s of Et(n))Ot.call(n,s)&&ht(o,s,n[s]);return o},jt=(o,n)=>Pe(o,rt(n));const gt=({name:o,onSubmit:n,defaultReply:s="[@author] ",autoSave:a,control:i,disableContinue:d})=>{const{data:r}=(0,k.Qy)(void 0),{fields:m,append:l,remove:u,update:h}=(0,T.jz)({control:i,name:o}),p=t.ETranslationCategories.autoModeration,A=(0,T.FH)({control:i,name:E.U5.Platform}),x=r&&A&&r[A].textLimit||void 0,v=()=>{l({id:(0,at.Ak)(),value:s})},S=R=>{u(R)};(0,g.useEffect)(()=>{m&&!m.length&&v()},[m]);const N=!m.length||d,O=(R,I,_)=>{h(R,jt(pt({}
1,_),{value:I}))};return(0,e.jsxs)("div",{className:me.reply,children:[(0,e.jsxs)("div",{className:me.replies,children:[(0,e.jsx)("div",{className:me.repliesHeading,children:(0,e.jsx)(t.TranslatedMessage,{translationKey:"AM_BOX_SOCIAL_MEDIA_ACTIONS_REPLY_HEADING",category:p})}),(0,e.jsx)("div",{className:me.inputs,children:m.map((R,I)=>(0,e.jsx)("div",{className:me.input,children:(0,e.jsx)(it,{control:i,name:`${o}.${I}.value`,order:I+1,withDeleteIcon:I>0,maxLength:x,onDelete:()=>S(I),update:_=>O(I,_,R),onBlur:a?n:void 0})},R.id))}),(0,e.jsxs)("div",{className:me.footer,children:[(0,e.jsx)("div",{className:me.addReplyWrapper,children:(0,e.jsxs)("div",{className:me.addReply,onClick:v,children:[(0,e.jsx)(t.Icon,{name:t.EIconNames.PlusCircle,size:t.EIconSizes.size12,color:t.EIconColors.Main}),(0,e.jsx)(t.TranslatedMessage,{translationKey:"AM_RULE_EDITOR_SOCIAL_MEDIA_ACTIONS_REPLY_ADD_REPLY",category:p})]})}),(0,e.jsxs)("div",{className:me.hint,children:[(0,e.jsx)(t.Icon,{name:t.EIconNames.QuestionMark,size:t.EIconSizes.size12,color:t.EIconColors.Grey}),(0,e.jsx)(t.TranslatedMessage,{withHTML:!0,translationKey:"AM_BOX_SOCIAL_MEDIA_ACTIONS_REPLY_ADD_HINT",category:p})]})]})]}),!a&&(0,e.jsx)(se,{onClick:n,disabled:N})]})},_t={actionEditor:"DWIJPwbXcjpqB3tVvZA6"};var So=Object.defineProperty,No=Object.defineProperties,Co=Object.getOwnPropertyDescriptors,Wt=Object.getOwnPropertySymbols,fo=Object.prototype.hasOwnProperty,Oo=Object.prototype.propertyIsEnumerable,Ht=(o,n,s)=>n in o?So(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,jo=(o,n)=>{for(var s in n||(n={}))fo.call(n,s)&&Ht(o,s,n[s]);if(Wt)for(var s of Wt(n))Oo.call(n,s)&&Ht(o,s,n[s]);return o},_o=(o,n)=>No(o,Co(n)),Xt=(o,n,s)=>new Promise((a,i)=>{var d=l=>{try{m(s.next(l))}catch(u){i(u)}},r=l=>{try{m(s.throw(l))}catch(u){i(u)}},m=l=>l.done?a(l.value):Promise.resolve(l.value).then(d,r);m((s=s.apply(o,n)).next())});const Gt=({onSubmit:o,autoSave:n,initialValue:s,actionName:a,triggerFormName:i})=>{const d="tagIds",r="sentiment",m="replies",l="userId",{register:u,control:h,getFieldState:p,unregister:A}=(0,T.xW)(),{name:x}=u(`${i}.${E.u$.ActionEditor}.${a}`,{required:!1,value:s}),v=(0,T.FH)({control:h,name:x}),S=()=>Xt(void 0,null,function*(){o(a,v)});(0,g.useEffect)(()=>{var _;if(n&&!p(x).error&&p(x).isDirty){const f=(0,oe.debounce)(()=>Xt(void 0,null,function*(){return S()}),300);return(_=f())==null||_.catch(W=>U.v.log(`[ActionEditor] action submit error ${JSON.stringify(W)}`)),()=>f.cancel()}},[n,v,p]),(0,g.useEffect)(()=>()=>A(x),[]);const N=(0,G.useSelector)(M.yN),{currentData:O}=(0,w.VA)([w.yn.roles,w.yn.image,w.yn.projects],{selectFromResult:_=>_o(jo({},_),{data:t.UsersFilters.activeUsersForProject(_.data,N.id)})}),R=O?Object.values(O):[],I=()=>{if(!a)return null;const _=!p(x).error&&p(x).isDirty;switch(a){case L.ESocialMediaActions.SOCIAL_ACTION_REPLY_AS_COMMENTS:case L.ESocialMediaActions.SOCIAL_ACTION_IN_PRIVATE_MESSAGE:return(0,e.jsx)(gt,{control:h,name:`${x}.${m}`,onSubmit:S,autoSave:n,disableContinue:!_});case L.ENapoleonCatActions.INBOX_ACTION_MARK:return(0,e.jsx)(We,{control:h,name:`${x}.${r}`,onSave:S,autoSave:n,disableContinue:!_,required:!0});case L.ENapoleonCatActions.INBOX_ACTION_MULTITAG:return(0,e.jsx)(fe,{control:h,name:`${x}.${d}`,onSubmit:S,autoSave:n,disableContinue:!_});case L.ENapoleonCatActions.INBOX_ACTION_ASSIGN:return(0,e.jsx)(ge,{control:h,onSubmit:S,options:R,name:`${x}.${l}`,autoSave:n,disableContinue:!_});default:return null}};return(0,e.jsx)("div",{className:_t.actionEditor,children:s&&I()})},Je={[L.ESocialMediaActions.SOCIAL_ACTION_BLOCK]:{icon:t.EIconNames.BoxBlockUser,title:"AM_BOX_SOCIAL_MEDIA_ACTIONS_BLOCK_TITLE"},[L.ESocialMediaActions.SOCIAL_ACTION_REACT_WITH_HEART]:{icon:t.EIconNames.BoxHeart,title:"AM_BOX_SOCIAL_MEDIA_ACTIONS_REACT_WITH_HEART_TITLE",subTitle:"AM_BOX_SOCIAL_MEDIA_ACTIONS_REACT_WITH_HEART_SUBTITLE"},[L.ESocialMediaActions.SOCIAL_ACTION_REPLY_AS_COMMENTS]:{icon:t.EIconNames.BoxChat,title:"AM_BOX_SOCIAL_MEDIA_ACTIONS_REPLY_AS_COMMENTS_TITLE",subTitle:"AM_BOX_SOCIAL_MEDIA_ACTIONS_REPLY_AS_COMMENTS_SUBTITLE",withData:!0}
1,[L.ESocialMediaActions.SOCIAL_ACTION_DELETE]:{icon:t.EIconNames.BoxDelete,title:"AM_BOX_SOCIAL_MEDIA_ACTIONS_DELETE_TITLE"},[L.ESocialMediaActions.SOCIAL_ACTION_HIDE]:{icon:t.EIconNames.BoxHide,title:"AM_BOX_SOCIAL_MEDIA_ACTIONS_HIDE_TITLE"},[L.ESocialMediaActions.SOCIAL_ACTION_IN_PRIVATE_MESSAGE]:{icon:t.EIconNames.BoxChat,title:"AM_BOX_SOCIAL_MEDIA_ACTIONS_IN_PRIVATE_MESSAGE_TITLE",subTitle:"AM_BOX_SOCIAL_MEDIA_ACTIONS_IN_PRIVATE_MESSAGE_SUBTITLE",withData:!0},[L.ENapoleonCatActions.INBOX_ACTION_ARCHIVE]:{icon:t.EIconNames.BoxArchive,title:"AM_BOX_NAPOLEON_CAT_ACTIONS_ARCHIVE_TITLE"},[L.ENapoleonCatActions.INBOX_ACTION_FLAG]:{icon:t.EIconNames.BoxFlag,title:"AM_BOX_NAPOLEON_CAT_ACTIONS_FLAG_TITLE"},[L.ENapoleonCatActions.INBOX_ACTION_MULTITAG]:{icon:t.EIconNames.BoxMultiTag,title:"AM_BOX_NAPOLEON_CAT_ACTIONS_MULTI_TAG_TITLE",withData:!0},[L.ENapoleonCatActions.INBOX_ACTION_ASSIGN]:{icon:t.EIconNames.BoxModerator,title:"AM_BOX_NAPOLEON_CAT_ACTIONS_ASSIGN_MODERATOR_TITLE",subTitle:"AM_BOX_NAPOLEON_CAT_ACTIONS_ASSIGN_MODERATOR_SUBTITLE",withData:!0},[L.ENapoleonCatActions.INBOX_ACTION_MARK]:{icon:t.EIconNames.BoxSmileFace,title:"AM_BOX_NAPOLEON_CAT_ACTIONS_SENTIMENT_TITLE",subTitle:"AM_BOX_NAPOLEON_CAT_ACTIONS_SENTIMENT_SUBTITLE",withData:!0}},yt={singleActionButton:"cjCaz6D4PjywP8SLfYdQ",title:"FypMXH5cJeIQQlIVyF0D",subTitle:"vyuQ4C105FSrkgmkPNul"},yo=({icon:o,title:n,subTitle:s,onClick:a})=>(0,e.jsxs)("div",{className:yt.singleActionButton,onClick:a,"data-testid":"single-action-button",children:[(0,e.jsx)(t.Icon,{name:t.EIconNames[o],size:t.EIconSizes.size43}),(0,e.jsx)("div",{className:yt.title,children:n}),s&&(0,e.jsx)("div",{className:yt.subTitle,children:s})]}),Vt={availableActionsList:"xomSYBjpWTUfFNsxO8Rr"};var Po=Object.defineProperty,Mo=Object.defineProperties,Bo=Object.getOwnPropertyDescriptors,zt=Object.getOwnPropertySymbols,Lo=Object.prototype.hasOwnProperty,Ro=Object.prototype.propertyIsEnumerable,$t=(o,n,s)=>n in o?Po(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,Fo=(o,n)=>{for(var s in n||(n={}))Lo.call(n,s)&&$t(o,s,n[s]);if(zt)for(var s of zt(n))Ro.call(n,s)&&$t(o,s,n[s]);return o},bo=(o,n)=>Mo(o,Bo(n));const Do=({actions:o,onActionClick:n})=>{const s=o.map(i=>bo(Fo({},Je[i]),{id:i})),a=(0,t.useTranslationCategory)(t.ETranslationCategories.autoModeration);return(0,e.jsx)("div",{className:Vt.availableActionsList,children:!!o?.length&&s.map(i=>(0,e.jsx)("div",{className:Vt.singleAction,children:(0,e.jsx)(yo,{onClick:()=>n(i.id),icon:i.icon,subTitle:i.subTitle&&a[i.subTitle],title:a[i.title]})},i.id))})},Me={selectedActionItem:"bvop166_5jgCYGbkDGYC",isExpanded:"msb5Ne1hXz5DFATKJyyD",orderIndicator:"GYwdkAcxQovhgp77F9Ek",nameWithIcon:"aj27wZ3tJrlX8lULX8U2",title:"QxZd6LaicmGFIK4vrgj3",subTitle:"rbZc_RlGXInWgFswk3sQ",deleteIcon:"zcaIsfmWC4082g2Y8WgN",isEditable:"vLetYG5hDr2vNJMfu3oH",toggleIcon:"WkhgZ3six8l2zW7GMi9U"},Kt=({icon:o,title:n,subTitle:s,onClick:a,onRemove:i,withData:d,classNames:r,isExpanded:m,order:l})=>(0,e.jsxs)("div",{className:H()(Me.selectedActionItem,r,{[Me.isExpanded]:m}),children:[!!l&&(0,e.jsx)("div",{className:Me.orderIndicator,children:l}),(0,e.jsxs)("div",{className:H()(Me.nameWithIcon,{[Me.isEditable]:d}),onClick:d?a:void 0,children:[(0,e.jsx)("div",{className:Me.toggleIcon,children:d&&(0,e.jsx)(t.Icon,{name:m?t.EIconNames.ArrowExpanded:t.EIconNames.ArrowCollapsed,size:t.EIconSizes.size14,color:t.EIconColors.Main})}),(0,e.jsx)(t.Icon,{name:t.EIconNames[o],size:t.EIconSizes.size43}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:Me.title,children:n}),s&&(0,e.jsx)("div",{className:Me.subTitle,children:s})]})]}),i&&(0,e.jsx)(t.Button,{theme:t.EButtonThemes.Wrapper,classNames:Me.deleteIcon,onClick:u=>{u.stopPropagation(),i()},children:(0,e.jsx)(t.Icon,{name:t.EIconNames.Delete})})]}),Xe={selectedActionsList:"NqHeLsLbKJRKAlBw43Ow",selectedAction:"zESh1nyj2IALl5ay2m7M",row:"bA8YzgfjdiBkC66ZEDDf",isEditable:"zxsxsztQgaw733LBWQ8A",editedAction:"Oz10lJUCIqlEc78ph12p",editor:"lN2rp7HZQ2gojtFcpnzZ"},wo=({selectedActions:o,onRemove:n,onClick:s,editedActionId:a,onActionChange:i,triggerFormName:d})=>{const r=o.length===0,m=(0,t.useTranslationCategory)(t.ETranslationCategories.autoModeration);return(0,e.jsx)("div",{className:H()(Xe.selectedActionsList,{[Xe.noSelectedActions]:r}),children:o.map((l,u)=>{const h=Je[l.name],p=typeof a=="number"?o[a]:null,A=(x,v)=>{i(u,{name:l.name,data:v})};return(0,e.jsxs)("div",{className:H()(Xe.selectedAction,{[Xe.isEditable]:h.withData}),children:[(0,e.jsx)("div",{className:H()(Xe.row,{[Xe.editedAction]:a===u}),children:(0,e.jsx)(Kt,{order:u+1,onClick:()=>{s(u)},onRemove:()=>n(u),icon:h.icon,subTitle:h.subTitle&&m[h.subTitle],title:m[h.title],withData:h.withData,isExpanded:a===u})}),a===u&&!!p&&(0,e.jsx)("div",{className:Xe.editor,children:(0,e.jsx)(Gt,{actionName:p.name,onSubmit:A,autoSave:!0,initialValue:p.data,triggerFormName:d},p.id)})]},l.id)})})},lt={backButton:"VVbTGCOHqCacMYUuFV3N",addButton:"i65YoqDsp5Yza_60yTcg",withBorderTop:"hmZQij_ail8LVZoOH2JL",addActionContainer:"ntcQ3b7jqRu3XSsyN1ku"},Yt=({triggerFormName:o,availableActions:n,actionsFlowConfig:s,actionFormName:a})=>{const{control:i,setValue:d}=(0,T.xW)(),{fields:r,append:m,remove:l}=(0,T.jz)({control:i,name:a}
1),u=B=>{const re=r.map(q=>q.name),_e=B.filter(q=>r?re.indexOf(q)===-1:!0),Ce=[];return s!==null&&re.forEach(q=>{const Ke=s[q];Ke&&Ce.push(...Ke)}),_e.filter(q=>Ce.indexOf(q)===-1)},[h,p]=(0,g.useState)(null),[A,x]=(0,g.useState)(null),[v,S]=(0,g.useState)(u(n)),[N,O]=(0,g.useState)(!1),R=()=>{O(!N)},I=B=>{l(B)},_=()=>{p(null),x(null)},P=B=>{const re=Je[B].withData;O(!0),re?x(B):(m({name:B,data:null}),O(!1))},f=B=>{p(B)},W=B=>{h===B?p(null):f(B)};(0,g.useEffect)(()=>{S(u(n))},[r,s,n]);const X=N||A,le=(B,re)=>{d(`${a}.${B}`,re)},he=()=>{_(),O(!1)},V=(B,re)=>{m({name:B,data:re}),_()},ne=(0,t.useTranslationCategory)(t.ETranslationCategories.autoModeration),z=B=>B!==void 0?ne[B]:"";return(0,e.jsxs)("div",{className:lt.actionSelectWithForm,children:[(0,e.jsx)(wo,{selectedActions:r,onRemove:I,onClick:W,onActionChange:le,editedActionId:h,triggerFormName:o}),(!!r.length||A)&&!!v.length&&(0,e.jsx)("div",{className:H()(X?lt.backButton:lt.addButton,r.length?lt.withBorderTop:""),onClick:X?he:R,children:(0,e.jsx)(t.Icon,{name:X?t.EIconNames.BackArrow:t.EIconNames.PlusCircle,color:t.EIconColors.Main})}),(N||!r.length)&&!A&&(0,e.jsx)(Do,{actions:v,onActionClick:P}),A&&(0,e.jsxs)("div",{className:lt.addActionContainer,children:[(0,e.jsx)(Kt,{icon:Je[A].icon,title:z(Je[A].title),subTitle:z(Je[A].subTitle)}),(0,e.jsx)(Gt,{onSubmit:V,initialValue:{},actionName:A,triggerFormName:o})]})]})},kt={andDivider:"Q3kctyEWtJAkufSq462v",label:"S60IytXpLlSe4RPcEcGR"},Pt=()=>{const o=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_BOX_TRIGGER_AND_DIVIDER");return(0,e.jsx)("div",{className:kt.andDivider,"data-testid":"automoderation-and-divider",children:(0,e.jsx)("span",{className:kt.label,children:o})})},ct={inputSummary:"MuaEvaRcggPof4FICqWh",editIcon:"ygsUSgK5itzoQxojS5UQ",titleText:"yd3pXiPkUsL2QJjSuGs3",values:"kRZuYe0hzwehIlKicP0w",value:"OXMO_1RNOG7nnwCFpIdm"},Te=({titleText:o,onClick:n,classNames:s,children:a})=>(0,e.jsxs)("div",{className:H()(ct.inputSummary,s),onClick:n,"data-testid":"automoderation-box-input-summary",children:[(0,e.jsx)(t.Icon,{name:t.EIconNames.Checkmark,color:t.EIconColors.Green,size:t.EIconSizes.size16}),(0,e.jsx)("div",{className:ct.titleText,children:`${o}:`}),(0,e.jsx)("div",{className:ct.values,children:a&&y().Children.map(a,i=>(0,e.jsx)("div",{className:ct.value,children:i}))}),(0,e.jsx)("div",{className:ct.editIcon,children:(0,e.jsx)(t.Icon,{name:t.EIconNames.Edit,size:t.EIconSizes.size16,color:t.EIconColors.Grey})})]}),Uo={typeBold:"IZ65ZIYK5srzubqMguwI",typeTag:"MgUCzNwPGPoR5C2oGU51"};var Y=(o=>(o.Tag="Tag",o.Bold="Bold",o))(Y||{});const Q=({children:o,valueType:n})=>(0,e.jsx)("span",{className:Uo[`type${n}`],children:o}),Mt={settingsBox:"_LvlbfYETbc5yjxYlDw4",isEnabled:"mzu7UITW4Du2xNd73uF8",isInvalid:"ZsrhCsWiRju5vfiRFr4n"},Ge=({children:o,isInvalid:n,className:s,isEnabled:a})=>(0,e.jsx)("div",{className:H()(Mt.settingsBox,s,{[Mt.isInvalid]:n,[Mt.isEnabled]:a}),"data-testid":"automoderation-settings-box",children:o});var Zt=c(20062),Jt=c(84200);const Ve={settingsBoxHeader:"FCAxixFb4HrIEXCUYLdH",isEnabled:"Cxl3ark90g1bg3EoFKSY",isToggleable:"PE_4Ngb1dalfp3hljnnU",headerText:"_4daRAxhDIefe6aUGWmy",heading:"mxf93jnuCE4bWQjxbKAZ",description:"gp1CV0FlogUUZjf4bmfv",toggle:"ciFWf97Y2eemlAO0nUWQ"},Bt=y().forwardRef(({onToggle:o,showToggle:n,isEnabled:s,headerDescription:a,headerText:i,icon:d},r)=>{const m=(u,h)=>{h?.stopPropagation(),o&&o(u)},l=u=>{m(!s,u)};return(0,e.jsxs)("div",{className:H()(Ve.settingsBoxHeader,{[Ve.isEnabled]:s,[Ve.isToggleable]:n}),onClick:l,ref:r,children:[(0,e.jsx)(t.Icon,{name:d,size:t.EIconSizes.size43}),(0,e.jsxs)("div",{className:Ve.headerText,children:[(0,e.jsx)("div",{className:Ve.heading,children:i}),(0,e.jsx)("div",{className:Ve.description,children:a})]}),n&&(0,e.jsx)("div",{className:Ve.toggle,children:(0,e.jsx)(Zt.A,{onChange:m,value:s,size:Jt.K.large,testId:"settings-box-header-switcher"})})]})});var Wo=Object.defineProperty,Ho=Object.defineProperties,Xo=Object.getOwnPropertyDescriptors,xt=Object.getOwnPropertySymbols,Qt=Object.prototype.hasOwnProperty,qt=Object.prototype.propertyIsEnumerable,eo=(o,n,s)=>n in o?Wo(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,Go=(o,n)=>{for(var s in n||(n={}))Qt.call(n,s)&&eo(o,s,n[s]);if(xt)for(var s of xt(n))qt.call(n,s)&&eo(o,s,n[s]);return o},Vo=(o,n)=>Ho(o,Xo(n)),zo=(o,n)=>{var s={};for(var a in o)Qt.call(o,a)&&n.indexOf(a)<0&&(s[a]=o[a]);if(o!=null&&xt)for(var a of xt(o))n.indexOf(a)<0&&qt.call(o,a)&&(s[a]=o[a]);return s};const Lt=o=>{var n=o,{toggleFormName:s}=n,a=zo(n,["toggleFormName"]);const{control:i}=(0,T.xW)();return(0,e.jsx)("div",{children:(0,e.jsx)(T.xI,{name:s,control:i,render:({field:d})=>(0,e.jsx)(Bt,Vo(Go({},a),{showToggle:!0,isEnabled:d.value,onToggle:d.onChange,ref:d.ref,name:s}))})})};var to=c(88643);const Qe={settingsBoxHeaderCompact:"vp_jkcDlKia7c08tkb_w",isEnabled:"feU6puMoRWYNA4_ykxdh",isToggleable:"mFhg_F2_lggFVIA_bu60",headerText:"E6UijY4hANL9_pywsWA6",toggle:"hGGVjcgYg9iVnPzQnuA8"},$o=y().forwardRef(({onToggle:o,isEnabled:n,headerDescription:s,headerText:a,className:i,classHeaderText:d,hintColor:r=t.EIconColors.White,isToggleEnabled:m=!0},l)=>{const u=(p,A)=>{A?.stopPropagation(),o(p)},h=()=>{o(!n)};return(0,e.jsxs)("div",{ref:l,className:H()(Qe.settingsBoxHeaderCompact,i,{[Qe.isEnabled]:n,[Qe.isToggleable]:m}),onClick:m?h:void 0,children:[(0,e.jsxs)("div",{className:H()(Qe.headerText),children:[(0,e.jsx)("div",{className:H()(Qe.heading,d),children:a}),(0,e.jsx)(to.A,{iconColor:r,children:(0,e.jsx)("span",{children:s})})]}),(0,e.jsx)("div",{className:Qe.toggle,children:(0,e.jsx)(Zt.A,{onChange:u,value:n,size:Jt.K.large,disabled:!m,testId:"settings-box-header-switcher"})})]})});var Ko=Object.defineProperty,Yo=Object.defineProperties,ko=Object.getOwnPropertyDescriptors,At=Object.getOwnPropertySymbols,oo=Object.prototype.hasOwnProperty,no=Object.prototype.propertyIsEnumerable,so=(o,n,s)=>n in o?Ko(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,Zo=(o,n)=>{for(var s in n||(n={}
1))oo.call(n,s)&&so(o,s,n[s]);if(At)for(var s of At(n))no.call(n,s)&&so(o,s,n[s]);return o},Jo=(o,n)=>Yo(o,ko(n)),Qo=(o,n)=>{var s={};for(var a in o)oo.call(o,a)&&n.indexOf(a)<0&&(s[a]=o[a]);if(o!=null&&At)for(var a of At(o))n.indexOf(a)<0&&no.call(o,a)&&(s[a]=o[a]);return s};const Rt=o=>{var n=o,{toggleFormName:s}=n,a=Qo(n,["toggleFormName"]);const{control:i}=(0,T.xW)();return(0,e.jsx)("div",{children:(0,e.jsx)(T.xI,{name:s,control:i,render:({field:d})=>(0,e.jsx)($o,Jo(Zo({},a),{isEnabled:d.value,onToggle:d.onChange,ref:d.ref,name:s}))})})};var It=c(97703),qo=c(55467);const en={keywordsCopyButton:"WFm4AZtAg1U98tvf3sFo"},tn=o=>{const n=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_KEYWORDS_COPY_BUTTON"),s=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_KEYWORDS_COPY_BUTTON_CONFIRMATION"),[a,i]=(0,g.useState)(n);let d=0;const r=()=>{i(s),d=window.setTimeout(()=>i(n),3*1e3)};return(0,g.useEffect)(()=>()=>clearTimeout(d),[]),(0,e.jsx)(qo.CopyToClipboard,{text:o.textToCopy,onCopy:r,children:(0,e.jsx)(t.ButtonWithIcon,{disabled:o.disabled,classNames:en.keywordsCopyButton,icon:t.EIconNames.Copy,text:a,buttonType:t.EButtonThemes.Ghost,buttonSize:t.EButtonSizes.Small})})},Oe={keywordsInput:"woTVNl_sZJuniAOPrbBR",keywordsContainer:"wDesBKZizXQvm9uiiBBE",keywordTextInput:"xuSEgofcv76HHU3x9wc5",scrollableList:"jTu9m9ZfTxtKUb2g5yhf",keywordItem:"enMXrK3Vr0WSHDRuCK96",keywordTag:"y9sNbL9yvGpQG0mOI3D5",inputWrapper:"B5YyM5WlZk18tBTEPwgG",actionWrapper:"WD5iLfsfPgEZ6dFK01h1",emojiIcon:"uA1cN7Hxd8IrwIGxCNFj"};var on=Object.defineProperty,nn=Object.defineProperties,sn=Object.getOwnPropertyDescriptors,vt=Object.getOwnPropertySymbols,ao=Object.prototype.hasOwnProperty,io=Object.prototype.propertyIsEnumerable,ro=(o,n,s)=>n in o?on(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,an=(o,n)=>{for(var s in n||(n={}))ao.call(n,s)&&ro(o,s,n[s]);if(vt)for(var s of vt(n))io.call(n,s)&&ro(o,s,n[s]);return o},rn=(o,n)=>nn(o,sn(n)),ln=(o,n)=>{var s={};for(var a in o)ao.call(o,a)&&n.indexOf(a)<0&&(s[a]=o[a]);if(o!=null&&vt)for(var a of vt(o))n.indexOf(a)<0&&io.call(o,a)&&(s[a]=o[a]);return s};const lo=o=>o.charAt(o.length-1)===",",co=o=>lo(o)?o.slice(0,o.length-1):o,Ft=(o,n)=>!n.some(a=>a.toLowerCase()===o.toLowerCase()),cn=({onChange:o,value:n,errorMessage:s,onBlur:a})=>{const[i,d]=(0,g.useState)(""),[r,m]=(0,g.useState)(""),l=(0,t.useTranslation)(t.ETranslationCategories.validation,"KEYWORD_ALREADY_EXISTS"),u=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_KEYWORDS_ADD_BUTTON"),h=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_KEYWORD_INPUT_PLACEHOLDER");let p=0;(0,g.useEffect)(()=>()=>window.clearTimeout(p),[]);const A=()=>{a&&a()},x=({native:P})=>{d(`${i}${P}`)},v=()=>{a&&a(),d(""),m("")},S=P=>{const f=co(P);if(!Ft(f,n)){m(l);return}f.length&&o([...n].concat(f)),v()},N=P=>{const f=[...n];f.splice(P,1),o(f)},O=P=>{const W=P.target.value.trim();W.length&&S(W)},R=P=>{const W=P.target.value;if(P.nativeEvent.inputType==="insertFromPaste")return;d(W);const X=co(W);Ft(X,n)?(m(""),lo(W)&&S(W)):m(l)},I=P=>{const f=P.clipboardData.getData("text");if(!f)return;d(f);const W=f.split(",").map(X=>X.trim());if(W.length){const X=W.filter(le=>Ft(le,n));X&&X.length?(o([...n].concat(X)),p=window.setTimeout(()=>{d("")},0)):m(l)}},_=()=>{S(i)};return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:Oe.keywordsInput,children:[(0,e.jsxs)("div",{className:Oe.inputWrapper,children:[(0,e.jsx)(t.TextInput,{name:"keywordsTextInput",classNames:Oe.keywordTextInput,value:i,onChange:R,onEnter:O,placeholder:h,autoComplete:"off",onPaste:I,onBlur:A,errors:r}),(0,e.jsxs)("div",{className:Oe.actionWrapper,children:[(0,e.jsx)("div",{className:Oe.emojiIcon,children:(0,e.jsx)(He.w,{dropdownPlacement:t.EFloatingUIPlacements.BottomStart,onEmojiSelect:x,children:(0,e.jsx)(t.Icon,{name:t.EIconNames.SmileFace,size:t.EIconSizes.size24})})}),(0,e.jsx)(t.ButtonWithIcon,{disabled:!i||!!r,classNames:Oe.keywordsCopyButton,icon:t.EIconNames.Plus,text:u,buttonType:t.EButtonThemes.Ghost,buttonSize:t.EButtonSizes.Small,onClick:_})]})]}),(0,e.jsx)("div",{className:Oe.keywordsContainer,children:(0,e.jsx)(t.ScrollbarWrapper,{className:Oe.scrollableList,children:n&&n.map((P,f)=>(0,e.jsx)("div",{className:Oe.keywordItem,children:(0,e.jsx)(t.TagSingle,{value:P,onRemove:()=>N(f),mainClassOverride:Oe.keywordTag,limitMaxWidth:!1})},P))})})]}),(0,e.jsx)(t.InputValidationErrors,{errors:s})]})},dn=o=>{var n=o,{name:s,required:a,control:i}=n,d=ln(n,["name","required","control"]);return(0,e.jsx)(T.xI,{name:s,control:i,rules:{required:a?"FIELD_REQUIRED":!1},render:({field:r,fieldState:m})=>{var l;return(0,e.jsx)(cn,rn(an({},d),{onChange:r.onChange,value:r.value||[],errorMessage:(l=m.error)==null?void 0:l.message,onBlur:r.onBlur}))}})},ze={description:"jrjAlgolWTwE58nEU6W9",keywords:"aANj42C7kNbp3FGnb4Vh",header:"NutWqCnpIsoFoxuuEBFv",controls:"xP4OJZ51zngVzyWeyuEG",keywordsButtons:"CrpVoAEGj2AeDPfLLv0l",advancedToggle:"euzB8KH8YPiB_JYoaZlt",advancedKeywordInput
1:"KYRzP0AEiZwAPhQZvzMA"};var un=(o,n,s)=>new Promise((a,i)=>{var d=l=>{try{m(s.next(l))}catch(u){i(u)}},r=l=>{try{m(s.throw(l))}catch(u){i(u)}},m=l=>l.done?a(l.value):Promise.resolve(l.value).then(d,r);m((s=s.apply(o,n)).next())});const mn=({required:o,control:n,advancedKeywordsAvailable:s,parentTriggerInputName:a})=>{const{setValue:i,trigger:d}=(0,T.xW)(),r=`${a}.${E.u$.Keywords}`,m=`${a}.${E.u$.AdvancedKeywords}`,l=`${a}.${E.u$.AdvancedKeywordsEnabled}`,u=(0,T.FH)({control:n,name:l}),h=(0,T.FH)({control:n,name:r}),p=(0,t.useTranslationCategory)(t.ETranslationCategories.autoModeration),A=p.AM_KEYWORDS_HEADER,x=p.AM_KEYWORDS_HINT,v=p.AM_KEYWORDS_ADVANCED_TURN_ON_LABEL,S=p.AM_KEYWORDS_ADVANCED_TURN_OFF_LABEL,N=p.AM_KEYWORDS_ADVANCED_INPUT_PLACEHOLDER,O=p.AM_KEYWORDS_CLEAR_BUTTON,R=u?S:v,I=s,f=u?"AM_KEYWORDS_ADVANCED_INPUT_DESCRIPTION":"AM_KEYWORDS_INPUT_DESCRIPTION",W=()=>{u?i(m,"",{shouldDirty:!0}):i(r,[],{shouldDirty:!0})};return(0,g.useEffect)(()=>{o||un(void 0,null,function*(){yield d(r)}).catch(X=>U.v.log(X,!1))},[o]),(0,e.jsxs)("div",{className:ze.keywords,children:[(0,e.jsxs)("div",{className:ze.header,children:[(0,e.jsx)("span",{children:A}),(0,e.jsx)(to.A,{children:(0,e.jsx)("span",{children:x})})]}),(0,e.jsxs)("div",{className:ze.controls,children:[I&&(0,e.jsx)("div",{className:ze.advancedToggle,children:(0,e.jsx)(It.c,{name:l,label:R,control:n})}),(0,e.jsxs)("div",{className:ze.keywordsButtons,children:[!u&&(0,e.jsx)(tn,{textToCopy:h.join(","),disabled:!h.length}),(0,e.jsx)(t.Button,{theme:t.EButtonThemes.Ghost,size:t.EButtonSizes.Small,onClick:W,children:O})]})]}),u?(0,e.jsx)(t.TextAreaWithForm,{required:o,classNames:ze.advancedKeywordInput,name:m,placeholder:N,expandOnClick:!0}):(0,e.jsx)(dn,{control:n,required:o,name:r}),(0,e.jsx)("div",{className:ze.description,children:(0,e.jsx)(t.TranslatedMessage,{category:t.ETranslationCategories.autoModeration,translationKey:f,withHTML:!0})})]})},bt={branchArrow:"xjP9v65gfUiJVzMeH7Ru",line:"rRH_oRiQ5t3Pkyawn8Ax",arrow:"fD9aMrjHrLsGgkST7l_Z"},En=()=>(0,e.jsxs)("div",{className:bt.branchArrow,children:[(0,e.jsx)("div",{className:bt.line}),(0,e.jsx)("div",{className:bt.arrow})]}),Tn={frameWithArrow:"xia5kuZNw24elrzjtiUS"},hn=({children:o})=>(0,e.jsxs)("div",{className:Tn.frameWithArrow,children:[o,(0,e.jsx)(En,{})]}),uo={placeholderPlus:"lYQUZx24K4ywj8EYAdDD",placeholderPlusEnabled:"kdvYuCxkNXzWCyq6k7TG"},mo=({disabled:o,onClick:n})=>(0,e.jsx)("div",{className:H()(uo.placeholderPlus,{[uo.placeholderPlusEnabled]:!o}),onClick:o?void 0:n,children:(0,e.jsx)(t.Icon,{name:t.EIconNames.PlusCircle,color:t.EIconColors.Main})}),pn=({selectedPlatform:o,selectedProfiles:n,selectedCondition:s,selectedSubCondition:a,selectedPosts:i,onClick:d})=>{const r=i?Object.values(i).flat():[],m=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_BOX_PROFILE_SUMMARY_PLATFORM"),l=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_BOX_PROFILE_SUMMARY_PROFILES"),u=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_PROFILE"),h=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_PROFILES"),p=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_BOX_PROFILE_SUMMARY_CONDITION"),A=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_BOX_PROFILE_SUMMARY_SUB_CONDITION"),x=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_BOX_PROFILE_SUMMARY_POSTS"),v=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_POST"),S=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_POSTS");return(0,e.jsxs)(e.Fragment,{children:[o&&(0,e.jsx)(Te,{titleText:m,onClick:d,children:(0,e.jsx)(Q,{valueType:Y.Bold,children:o})}),!!n?.length&&(0,e.jsx)(Te,{titleText:l,onClick:d,children:(0,e.jsxs)(Q,{valueType:Y.Bold,children:[`${n.length} `,n.length===1?u:h]})}),s&&(0,e.jsx)(Te,{titleText:p,onClick:d,children:(0,e.jsx)(Q,{valueType:Y.Bold,children:s})}),a&&(0,e.jsx)(Te,{titleText:A,onClick:d,children:(0,e.jsx)(Q,{valueType:Y.Bold,children:a})}),!!r?.length&&(0,e.jsx)(Te,{titleText:x,onClick:d,children:(0,e.jsxs)(Q,{valueType:Y.Bold,children:[`${r.length} `,r.length===1?v:S]})})]})},gn={},xn=o=>({name:o.name,id:o.id,imageUrl:o.imageUrl}),An=({availableProfiles:o,platformIcon:n,name:s,disabled:a})=>{const i=o.map(m=>xn(m)),d=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_BOX_PROFILE_SELECT_PROFILES_PLACEHOLDER"),r=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_BOX_PROFILE_SELECTED_PROFILES_SUMMARY");return(0,e.jsx)("div",{className:gn.profilesSelect,children:(0,e.jsx)(t.SelectMultiWithForm,{options:i,name:s,showSelectAllHeader:!0,selectedValuesSummaryText:r,selectedValuesSummaryIcon:n,placeholder:d,showSelectedValuesList:!0,disabled:a,isSearchable:!1,required:!0})})};var Re=c(85723),In=c(90579),vn=c(90360),Sn=c(51746),Nn=c(61408);const Be={post:"JHr4CHdX8Q01HgAW5kxU",active:"q7JVWlVsO3VMvWQXzr27",disabled:"i6WPkWF_4khyIDE9XR6M",image:"QQOWmVczBkAiF0eMwhch",errorImage:"_YJuLA_kgX9JOb6dAIVE",mainContent:"e2GxdVZV_pHWlb2Hut15",text:"b4g_Iu_IEYo7GOxyZLu_",details:"KsF6bN1iWYd3aX_xcPUs",checkbox:"NH2YiLZamXbIFuE5agzq"},Cn=({text:o,imageUrl:n,date:s,link:a,id:i,checked:d,disabled:r,refresh:m})=>{const[l,u]=(0,g.useState)(!1),[h,p]=(0,g.useState)(n),[A,x]=(0,g.useState)(!1),v=()=>{u(!0),!l&&typeof m=="function"?(x(!0),m(i)):(p(Nn),x(!1))};return(0,g.useEffect)(()=>{n&&p(n)},[n]),(0,e.jsxs)("div",{className:H()(Be.post,{[Be.active]:d,[Be.disabled]:r}),children:[(0,e.jsxs)("div",{className:Be.mainContent,children:[(0,e.jsx)("div",{className:Be.checkbox,children:(0,e.jsx)("input",{type:"checkbox",readOnly:!0,checked:d})}),n&&(0,e.jsx)("div",{className:Be.image,children:A?(0,e.jsx)("div",{className:Be.errorImage}):(0,e.jsx)("img",{src:h,alt:"Post picture",width:72,height:72,onError:v})}),(0,e.jsx)("p",{className:Be.text,children:o})]}),(0,e.jsxs)("div",{className:Be.details,children:[(0,e.jsx)("div",{children:`ID: ${i}`}),(0,e.jsx)("div",{children:s}),(0,e.jsx)(Sn.g,{url:a,iconSize:t.EIconSizes.size15,children:(0,e.jsx)(t.TranslatedMessage,{category:t.ETranslationCategories.autoModeration,translationKey:"AM_RULE_EDITOR_POSTS_VIEW_ON_SOCIAL_PAGE"})})]})]})};var fn=c(43236);const Dt={posts:"ZYx5SxXile_voTqWTjm9",listWrapper:"xKRyPBAlDDcaGV6wMNCm",innerWrapper:"hc21ptWVcv6WEhS6v74r",postWrapper:"ziINrt36fAEzrFScuVYL"},On=({posts:o,limit:n=0,selectedPostsIds:s=[],onSelect:a,onDeselect:i,onScrollBottom:d,canLoadMore:r,refreshPost:m})=>{const l=!!n&&n<=s.length;return(0,e.jsx)("div",{className:Dt.posts,children:(0,e.jsx)(fn.w,{onScrollBottom:d,canLoadMoreItems:r,scrollBarTheme:t.EScrollbarWrapperThemes.GrayRounded,children:(0,e.jsx)("div",{className:Dt.innerWrapper,children:o.map(({id:u,text:h,imageUrls:p,dateToDisplay:A,url:x,profileId:v})=>{const S=s.indexOf(u)!==-1,N=!S&&l;return(0,e.jsx)("div",{className:Dt.postWrapper,onClick:()=>S?i(u,v):a(u,v),children:(0,e.jsx)(Cn,{id:u,text:h,imageUrl:p[0],date:A,link:x,checked:S,disabled:N,refresh:m},u)},u)})})})})},Eo={postsSelectWithForm:"OG0rg_e_zO8ZxHTRIzxK",postsLoader:"VuS9lQtQPEafN2PLYjhv"};var jn=Object.defineProperty,_n=Object.defineProperties,yn=Object.getOwnPropertyDescriptors,St=Object.getOwnPropertySymbols,To=Object.prototype.hasOwnProperty,ho=Object.prototype.propertyIsEnumerable,po=(o,n,s)=>n in o?jn(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,wt=(o,n)=>{for(var s in n||(n={}))To.call(n,s)&&po(o,s,n[s]);if(St)for(var s of St(n))ho.call(n,s)&&po(o,s,n[s]);return o},Pn=(o,n)=>_n(o,yn(n)),Mn=(o,n)=>{var s={};for(var a in o)To.call(o,a)&&n.indexOf(a)<0&&(s[a]=o[a]);if(o!=null&&St)for(var a of St(o))n.indexOf(a)<0&&ho.call(o,a)&&(s[a]=o[a]);return s};const Bn=y().forwardRef(({posts:o=[],noPostsInfo:n,isLoading:s=!1,onScrollBottom:a,canLoadMore:i,onChange:d,selectedPostsIds:r,errors:m,onBlur:l,refreshPost:u},h)=>{const p=v=>{d(v),l&&l()},A=(v,S)=>{const N=wt({},r);N[S]?N[S]=N[S].concat(v):N[S]=[v],p(N)},x=(v,S)=>{const N=wt({},r);N[S]&&(N[S]=N[S].filter(O=>O!==v)),N.unknownProfileId&&(N.unknownProfileId=N.unknownProfileId.filter(O=>O!==v)),p(N)};return(0,e.jsxs)("div",{className:Eo.postsSelectWithForm,ref:h,children:[s&&(0,e.jsx)("div",{className:Eo.postsLoader,children:(0,e.jsx)(t.Loader,{})}),!!o.length&&(0,e.jsx)(On,{canLoadMore:i,posts:o,selectedPostsIds:Object.values(r).flat(),onSelect:A,onDeselect:x,onScrollBottom:a,refreshPost:u}),!s&&!o.length&&(0,e.jsx)("div",{children:n}),(0,e.jsx)(t.InputValidationErrors,{errors:m})]})}),Ln=o=>{var n=o,{name:s}=n,a=Mn(n,["name"]);const{control:i}=(0,T.xW)();return(0,e.jsx)(T.xI,{name:s,control:i,rules:{validate:d=>Object.values(d).some(r=>!!r.length)||"FIELD_REQUIRED"},render:({field:d,fieldState:r})=>{var m;return(0,e.jsx)(Bn,Pn(wt({},a),{onBlur:d.onBlur,onChange:d.onChange,selectedPostsIds:d.value||[],errors:(m=r.error)==null?void 0:m.message}))}})},go={subConditionSelect:"Jki1qtA9CiOvJsrmsAQI",title:"Vl6GWpxEiW0usXzo_UuX"},Rn=({options:o=[],subConditionFormName:n,control:s})=>{const a=(0,t.useTranslationCategory)(t.ETranslationCategories.autoModeration),i=a.AM_CONDITION_TIT
1LE,d=()=>o.map(r=>({name:a[te.$T[r]],id:r}));return(0,e.jsxs)("div",{className:go.subConditionSelect,children:[(0,e.jsx)("span",{className:go.title,children:i}),(0,e.jsx)(t.SelectSingleWithForm,{control:s,options:d(),name:n,required:!0})]})},Fe={conditionSelect:"gDpQnkwOQwQCS7kSzBfP",title:"S7t_cmvjM_JqKwkqUQ9d",subTitle:"piGpKxFXzlFNhUzG6HKg",section:"OWfD4kLRd1KLpDIFNXAS",postsWrapper:"jrJ2r65HJ9T1p8gJ7m7g"};var Fn=Object.defineProperty,xo=Object.getOwnPropertySymbols,bn=Object.prototype.hasOwnProperty,Dn=Object.prototype.propertyIsEnumerable,Ao=(o,n,s)=>n in o?Fn(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,wn=(o,n)=>{for(var s in n||(n={}))bn.call(n,s)&&Ao(o,s,n[s]);if(xo)for(var s of xo(n))Dn.call(n,s)&&Ao(o,s,n[s]);return o},dt=(o,n,s)=>new Promise((a,i)=>{var d=l=>{try{m(s.next(l))}catch(u){i(u)}},r=l=>{try{m(s.throw(l))}catch(u){i(u)}},m=l=>l.done?a(l.value):Promise.resolve(l.value).then(d,r);m((s=s.apply(o,n)).next())});const Un=({conditionsForPlatform:o,subConditionsConfigForPlatform:n,disabled:s,selectedProfilesIds:a,isFormInitialized:i=!0,afterChange:d})=>{var r;const{setValue:m,control:l,getValues:u}=(0,T.xW)(),h=(0,T.FH)({control:l,name:E.U5.Condition}),p=(0,T.FH)({name:E.U5.ConditionPosts}),A=10,[x,v]=(0,g.useState)([]),[S,N]=(0,g.useState)(!1),[O,R]=(0,g.useState)(null),[I,_]=(0,g.useState)(null),P=(0,g.useRef)(""),f=(0,g.useRef)(""),W=(0,g.useRef)(""),X=(0,G.useSelector)(C=>C.global.userLoaded),{triggerGetPosts:le,isFetching:he,isNewInbox:V}=(0,In.Y)(),ne=(0,t.useTranslationCategory)(t.ETranslationCategories.autoModeration),z=ne.AM_MESSAGE_TYPE_TITLE,B=ne.AM_NO_POSTS_INFO,re=ne.AM_BOX_PROFILE_POSTS_TITLE,_e=ne.AM_BOX_PROFILE_POSTS_DAYS_INFO,Ce=y().useMemo(()=>o.map(C=>({name:ne[te.xY[C]],id:C})),[o,ne]),q=C=>C&&n?n[C]:null,Ke=()=>{if(!h)return;const C=q(h);C&&_(C)};(0,g.useEffect)(()=>{var C,F;if(I){const b=u(E.U5.SubCondition);if(!(b?((C=I.options)==null?void 0:C.indexOf(b))!==-1:!1)||!I.options){const st=((F=I.options)==null?void 0:F.indexOf(Re.ESubConditionOptions.ALL))!==-1||!I.options?Re.ESubConditionOptions.ALL:I.options[0];m(E.U5.SubCondition,st,{shouldValidate:!1})}I.type!==Re.ESubConditionTypes.POSTS&&m(E.U5.ConditionPosts,{},{shouldValidate:!1})}},[I]),(0,g.useEffect)(()=>{h&&Ke()},[h]);const ut=C=>C.length?C.filter(F=>{if(!a.includes(F.profileId)){const b=wn({},p);return Object.keys(p).forEach(ce=>{const st=[...b[ce].filter(is=>is!==F.id)];st.length?b[ce]=st:delete b[ce]}),m(E.U5.ConditionPosts,b,{shouldValidate:!0}),!1}return!0}):(m(E.U5.ConditionPosts,{},{shouldValidate:!1}),C),nt=C=>{const F=ut(C);v(F||[[]])},mt=C=>{nt((0,vn.T)(x,C))},Ye=C=>{if(C?.id){const F=x.map(b=>b.id===C.id?C:b);v(F)}},ee=(C=0,F=null,b)=>dt(void 0,null,function*(){return le({limit:A,selectedProfilesIds:a,postIdsToInclude:b,beforeDate:C,cursor:F},!0)}),ke=(0,g.useMemo)(()=>Object.values(p??{}).flat().filter(Boolean),[p]),Ct=()=>[a.join(","),ke.slice().sort().join(",")].join("|"),ft=()=>dt(void 0,null,function*(){var C;try{N(!1),R(null);const F=yield ee(0,null,ke);R((C=F?.cursor)!=null?C:null),nt(F?.posts||[])}catch(F){U.v.log(`[ListWithAutoFetching] Failed to get posts ${JSON.stringify(F)}`)}}),Ut=()=>dt(void 0,null,function*(){var C;const F=ke.filter(b=>!x.some(ce=>ce.id===b));if(F.length)try{const b=yield ee(0,null,F);(C=b?.posts)!=null&&C.length&&mt(b.posts)}catch(b){U.v.log(`[ListWithAutoFetching] Failed to get saved posts ${JSON.stringify(b)}`)}}),ss=()=>dt(void 0,null,function*(){const C=x[x.length-1],F=C?.dateTimestamp||0;try{const b=yield ee(F,V?O:null),ce=b?.posts;b?.cursor!==void 0&&R(b.cursor),ce?.length?mt(ce):N(!0)}catch(b){U.v.log(`[ListWithAutoFetching] Failed to get more posts ${JSON.stringify(b)}`)}}),as=C=>dt(void 0,null,function*(){var F;if(!x.some(st=>st.id===C))return;const ce=yield le({selectedProfilesIds:a,limit:A,beforeDate:0,statusId:C,refresh:!0});(F=ce?.posts)!=null&&F[0]&&Ye(ce.posts[0])});return(0,g.useEffect)(()=>{if(V||I?.type!==Re.ESubConditionTypes.POSTS||!i)return;const C=a.join(",");W.current!==C&&(W.current=C,v([]),N(!1),ft().catch(F=>U.v.log(`[ListWithAutoFetching] Failed to get posts ${JSON.stringify(F)}`)))},[a,I,i,V]),(0,g.useEffect)(()=>
1{if(!V||I?.type!==Re.ESubConditionTypes.POSTS||!X||!i)return;const C=a.join(",");P.current!==C&&(P.current=C,f.current="",v([]),N(!1),R(null),ft().catch(F=>U.v.log(`[ListWithAutoFetching] Failed to get posts ${JSON.stringify(F)}`)))},[a,I,V,X,i]),(0,g.useEffect)(()=>{if(!V||I?.type!==Re.ESubConditionTypes.POSTS||!X||!i||!ke.length||he||!ke.some(b=>!x.some(ce=>ce.id===b)))return;const F=Ct();f.current!==F&&(f.current=F,Ut().catch(b=>U.v.log(`[ListWithAutoFetching] Failed to get saved posts ${JSON.stringify(b)}`)))},[x,i,V,he,ke,a,I,X]),(0,e.jsxs)("div",{className:Fe.conditionSelect,children:[(0,e.jsxs)("div",{className:Fe.section,children:[(0,e.jsx)("span",{className:Fe.title,children:z}),(0,e.jsx)(t.SelectSingleWithForm,{control:l,options:Ce,name:E.U5.Condition,disabled:s,afterChange:d,required:!0})]}),I?.type===Re.ESubConditionTypes.LIST&&((r=I?.options)==null?void 0:r.length)&&(0,e.jsx)("div",{className:Fe.section,children:(0,e.jsx)(Rn,{control:l,options:I.options||[],subConditionFormName:E.U5.SubCondition})}),I?.type===Re.ESubConditionTypes.POSTS&&(0,e.jsxs)("div",{className:H()(Fe.section,Fe.postsWrapper),children:[(0,e.jsx)("span",{className:Fe.title,children:re}),(0,e.jsx)("span",{className:Fe.subTitle,children:_e}),(0,e.jsx)(Ln,{posts:x,name:E.U5.ConditionPosts,noPostsInfo:B,isLoading:he,canLoadMore:!S,onScrollBottom:ss,refreshPost:as})]})]})},qe={content:"oT3gjTDbhUACLA81EqE4",title:"D04m_Jq7OyHqi0gJOHe3",section:"mHZuthci0JANeiXwn3Fg"},Wn=({conditionsConfig:o,isFormInitialized:n=!0,startsInEditMode:s=!0})=>{const{formState:a,setValue:i,control:d,getFieldState:r,getValues:m}=(0,T.xW)(),{submitCount:l}=a,u=(0,T.FH)({control:d,name:E.U5.Platform}),h=(0,T.FH)({control:d,name:E.U5.Condition}),p=(0,T.FH)({control:d,name:E.U5.SubCondition}),A=(0,T.FH)({control:d,name:E.U5.ConditionPosts}),x=(0,T.FH)({control:d,name:E.U5.AttachedToProfiles}),[v,S]=(0,g.useState)(s),[N,O]=(0,g.useState)([]),R=(0,G.useSelector)(M.j3),{data:I}=(0,k.Qy)(void 0),_=[E.U5.Platform,E.U5.AttachedToProfiles,E.U5.Condition,E.U5.SubCondition,E.U5.ConditionPosts],P=t.SocialPlatforms.map(ee=>({name:ee,id:ee,icon:t.ProfilePlatformIconsMap[ee]})),f=(0,t.useTranslationCategory)(t.ETranslationCategories.autoModeration),W=f.AM_BOX_PROFILE_HEADER,X=f.AM_BOX_PROFILE_DESCRIPTION,le=f.AM_BOX_PROFILE_SELECT_PLATFORM_PLACEHOLDER,he=f.AM_BOX_PROFILE_SELECT_PLATFORM_TITLE,V=f.AM_BOX_PROFILE_SELECT_PROFILES_TITLE,ne=()=>S(!0),z=()=>S(!1),B=()=>Object.values(R).filter(ee=>ee.platform===u),re=()=>{m(E.U5.Triggers).forEach((ke,Ct)=>{const ft=`${E.U5.Triggers}.${Ct}.${E.u$.SocialAction}`;i(ft,[],{shouldValidate:!1});const Ut=`${E.U5.Triggers}.${Ct}.${E.u$.NapoleonAction}`;i(Ut,[],{shouldValidate:!1})})},_e=()=>{j()(x),i(E.U5.AttachedToProfiles,[],{shouldValidate:!1}),j()(h)||i(E.U5.Condition,null,{shouldValidate:!1}),i(E.U5.Condition,null,{shouldValidate:!1}),re()},Ce=()=>re();(0,g.useEffect)(()=>{const ee=B();O(ee)},[u]),(0,g.useEffect)(()=>{const ee=B();O(ee)},[R]);const q=y().useMemo(()=>I&&u?Object.keys(I[u].conditions):[],[I,u]);(0,g.useEffect)(()=>{!n||j()(q)||(!h||q.indexOf(h)===-1)&&i(E.U5.Condition,q[0],{shouldValidate:!1})},[q,n,i,h]);const Ke=h===L.EAutoModerationConditions.CONDITION_COMMENT_AND_SUBCOMMENT_FOR_SPECIFIC_POST||h===L.EAutoModerationConditions.CONDITION_COMMENT_FOR_SPECIFIC_POST||h===L.EAutoModerationConditions.CONDITION_SUBCOMMENT_FOR_SPECIFIC_POST,ut=[E.U5.Platform,E.U5.AttachedToProfiles,...Ke?[E.U5.ConditionPosts]:[]].some(ee=>j()(m(ee))||r(ee).error),nt=(0,G.useSelector)(ue.IZ),Ye=!_.every(ee=>!r(ee,a).error)&&(!!l||l===0&&!!nt);return(0,e.jsxs)(Ge,{isEnabled:!0,isInvalid:Ye,children:[(0,e.jsx)(Bt,{isEnabled:!0,showToggle:!1,headerText:W,headerDescription:X,icon:t.EIconNames.BoxUser}),v&&(0,e.jsxs)("div",{className:qe.content,children:[(0,e.jsxs)("div",{className:qe.section,children:[(0,e.jsx)("span",{className:qe.title,children:he}),(0,e.jsx)(t.SelectSingleWithForm,{control:d,options:P,name:E.U5.Platform,placeholder:le,afterChange:_e,required:!0})]}),(0,e.jsxs)("div",{className:qe.section,children:[(0,e.jsx)("span",{className:qe.title,children:V}),(0,e.jsx)(An,{disabled:!u,availableProfiles:N,platformIcon:u?t.ProfilePlatformIconsMap[u]:void 0,name:E.U5.AttachedToProfiles})]}),(0,e.jsx)("div",{className:qe.section,children:q&&!!x.length&&o&&(0,e.jsx)(Un,{conditionsForPlatform:q,subConditionsConfigForPlatform:u?Le.l2[u]:null,selectedProfilesIds:x,isFormInitialized:n,afterChange:Ce})}),(0,e.jsx)(se,{onClick:z,disabled:ut})]}),!v&&(0,e.jsx)(pn,{selectedPlatform:u||"",selectedProfiles:x,selectedCondition:h?f[te.xY[h]]:"",selectedSubCondition:p?f[te.$T[p]]:"",selectedPosts:A,onClick:ne})]})};var Hn=c(1603);const et={},Xn=({selectedSentiment:o,selectedInboxTags:n,selectedUserTags:s,selectedKeywords:a,selectedAdvancedKeywords:i,selectedAdvancedKeywordsEnabled:d,onClick:r})=>{const m=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_BOX_TRIGGER_SUMMARY_AI_SENTIMENT"),l=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_BOX_TRIGGER_SUMMARY_USER_TAGS"),u=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_BOX_TRIGGER_SUMMARY_INBOX_TAGS"),h=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_BOX_TRIGGER_SUMMARY_KEYWORDS"),p=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_BOX_TRIGGER_SUMMARY_ADVANCED_KEYWORDS"),A=o&&(0,t.useTranslation)(t.ETranslationCategories.main,o),x=n?.length,v=s?.length,S=a?.length,N=a?.length;return(0,e.jsxs)("div",{className:et.boxTriggerSummary,children:[o&&(0,e.jsx)(Te,{onClick:r,titleText:m,classNames:et.boxTriggerSummary,children:(0,e.jsx)(Q,{valueType:Y.Bold,children:A})}),!!x&&(0,e.jsxs)(Te,{onClick:r,titleText:u,classNames:et.boxTriggerSummary,children:[(0,e.jsx)(Q,{valueType:Y.Tag,children:n[0].tag}),x>1&&(0,e.jsx)(Q,{valueType:Y.Tag,children:`+ ${x-1}`})]}),!!v&&(0,e.jsxs)(Te,{onClick:r,titleText:l,classNames:et.boxTriggerSummary,children:[(0,e.jsx)(Q,{valueType:Y.Tag,children:s[0].tag}),v>1&&(0,e.jsx)(Q,{valueType:Y.Tag,children:`+ ${v-1}`})]}),!d&&!!S&&(0,e.jsxs)(Te,{onClick:r,titleText:h,classNames:et.boxTriggerSummary,children:[!!S&&(0,e.jsx)(Q,{valueType:Y.Tag,children:a[0]}),S>1&&(0,e.jsx)(Q,{valueType:Y.Tag,children:`+ ${S-1}`})]}),d&&!!N&&(0,e.jsx)(Te,{onClick:r,titleText:p,classNames:et.boxTriggerSummary,children:(0,e.jsx)(Q,{valueType:Y.Bold,children:i})})]})},tt={content:"lR3FUrScOsMVlMkiv5LC",section:"X1rJnx8c7g5_1gIxqIRZ",sectionName:"Ko6WQDOQTzdINPzdcVZr",tagInfo:"wOu0UFBTLm8GTeWA4GTX"};var Gn=c(85028);
1const Vn=({name:o,withToggle:n=!0,isRequired:s})=>{const{control:a,getFieldState:i,formState:d,trigger:r}=(0,T.xW)(),{submitCount:m}=d,l=(0,G.useSelector)(t.tagSelector),u=!(0,G.useSelector)(M.Ne),h=`${o}.${E.u$.Sentiment}`,p=`${o}.${E.u$.UserTags}`,A=`${o}.${E.u$.InboxTags}`,x=`${o}.${E.u$.TriggerBoxEnabled}`,v=(0,T.FH)({control:a,name:x}),S=(0,T.FH)({control:a,name:h}),N=(0,T.FH)({control:a,name:A}),O=(0,T.FH)({control:a,name:p}),R=(0,T.FH)({control:a,name:`${o}.${E.u$.AdvancedKeywordsEnabled}`}),I=(0,T.FH)({control:a,name:`${o}.${E.u$.Keywords}`}),_=(0,T.FH)({control:a,name:`${o}.${E.u$.AdvancedKeywords}`}),P=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_BOX_TRIGGER_SENTIMENT_TITLE"),f=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_BOX_TRIGGER_MESSAGE_TAG_TITLE"),W=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_BOX_NAPOLEON_CAT_ACTIONS_SENTIMENT_CHOOSE_TITLE"),X=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_BOX_TRIGGER_USER_TAG_TITLE"),le=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_BOX_TRIGGER_USER_TAG_PLACEHOLDER"),he=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_BOX_TRIGGER_HEADER"),V=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_BOX_TRIGGER_DESCRIPTION"),ne=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_BOX_TRIGGER_TAG_INFORMATION_TEXT"),[z,B]=(0,g.useState)(!0),re=()=>B(!0),_e=()=>B(!1),Ce=y().useMemo(()=>l?l.user.filter(Ye=>O.includes(Ye.id)):[],[O,l]),q=y().useMemo(()=>l?l.system.filter(Ye=>Ye.id===N):[],[N,l]),ut=!j()(O)||!j()(I)||!j()(_)||!j()(N)||!j()(S),nt=i(`${o}.${E.u$.Sentiment}`).error||i(`${o}.${E.u$.AdvancedKeywords}`).error||i(`${o}.${E.u$.Keywords}`).error||i(`${o}.${E.u$.InboxTags}`).error||i(`${o}.${E.u$.UserTags}`).error,mt=v&&s?nt&&!!m:!1;return(0,e.jsxs)(Ge,{isInvalid:mt,isEnabled:v,children:[n?(0,e.jsx)(Lt,{headerText:he,headerDescription:V,icon:t.EIconNames.BoxLightning,toggleFormName:x}):(0,e.jsx)(Bt,{headerText:he,headerDescription:V,icon:t.EIconNames.BoxLightning,showToggle:!1,isEnabled:!0}),v&&z&&(0,e.jsxs)("div",{className:tt.content,children:[(0,e.jsx)(We,{control:a,name:h,title:P,placeholder:W,autoSave:!0,stretch:!0,isClearable:!0,disabled:u,required:s&&j()(O)&&j()(I)&&j()(_)&&j()(N),revalidate:r}),l&&l?.system.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Pt,{}),(0,e.jsxs)("div",{className:tt.section,children:[(0,e.jsx)("div",{className:tt.sectionName,children:f}),(0,e.jsx)(Gn.p,{control:a,name:A,tags:l?.system||[],placeholder:le,disabled:u,limit:1,value:N,required:s&&j()(I)&&j()(_)&&j()(S)&&j()(O),reValidate:r})]})]}),(0,e.jsx)(Pt,{}),(0,e.jsxs)("div",{className:tt.section,children:[(0,e.jsxs)("div",{className:tt.sectionName,children:[X,":"]}),(0,e.jsx)(Hn.w,{control:a,name:p,tags:l?.user||[],placeholder:le,limit:1,required:s&&j()(I)&&j()(_)&&j()(S)&&j()(N),reValidate:r}),O.length!==0&&(0,e.jsx)("div",{className:tt.tagInfo,children:ne})]}),(0,e.jsx)(Pt,{}),(0,e.jsx)(mn,{control:a,required:s&&j()(O)&&j()(S)&&j()(N),advancedKeywordsAvailable:!0,parentTriggerInputName:o}),(0,e.jsx)(se,{onClick:_e,disabled:!ut})]}),v&&!z&&(0,e.jsx)(Xn,{onClick:re,selectedSentiment:S,selectedInboxTags:q,selectedUserTags:Ce,selectedKeywords:I,selectedAdvancedKeywords:_,selectedAdvancedKeywordsEnabled:R})]})};var zn=c(76987);const $e={headerFacebook:"pfcyPpHA3n2I57qyauhE",headerTiktok:"ZARApG8Cv3iuAqHl3k08",headerInstagram:"eLsnZ6hFISOlhk_YDItC",headerLinkedin:"_HDsI11G5TGO0P3x9nGJ",headerYoutube:"bX__1qs3JjphEsf_c4QK"},$n=({isBoxAvailable:o,triggerFormName:n,availableActions:s})=>{const a=`${n}.${E.u$.SocialActionBoxEnabled}`,i=`${n}.${E.u$.NapoleonActionBoxEnabled}`,d=`${n}.${E.u$.SocialAction}`,r=`${n}.${E.u$.NapoleonAction}`,{formState:m,setValue:l,control:u}=(0,T.xW)(),{submitCount:h}=m,p=(0,T.FH)({control:u,name:a}),A=(0,T.FH)({control:u,name:i}),x=(0,T.FH)({control:u,name:E.U5.Platform}),v=(0,T.FH)({control:u,name:d}),S=(0,T.FH)({control:u,name:r}),N=!!h&&(j()(v)&&j()(S)||!p&&!A),O=()=>{switch(x){case t.EProfilePlatformTypes.Facebook:return $e.headerFacebook;case t.EProfilePlatformTypes.InstagramAds:case t.EProfilePlatformTypes.Instagram:return $e.headerInstagram;case t.EProfilePlatformTypes.Linkedin:return $e.headerLinkedin;case t.EProfilePlatformTypes.TiktokAds:case t.EProfilePlatformTypes.Tiktok:return $e.headerTiktok;case t.EProfilePlatformTypes.YouTube:return $e.headerYoutube;default:return $e.headerInstagram}},R=(0,t.useTranslationCategory)(t.ETranslationCategories.autoModeration),I=R.AM_BOX_SOCIAL_MEDIA_ACTIONS_HEADER,_=R.AM_BOX_SOCIAL_MEDIA_ACTIONS_DESCRIPTION,P=()=>l(a,!0);return(0,g.useEffect)(()=>
1{o||l(a,!1)},[o]),(0,e.jsxs)(Ge,{isEnabled:p,isInvalid:N,children:[(0,e.jsx)(Rt,{isToggleEnabled:o,headerText:I,headerDescription:_,className:O(),toggleFormName:a}),p&&(0,e.jsx)("div",{className:$e.content,children:(0,e.jsx)(Yt,{actionsFlowConfig:zn.s,availableActions:s,triggerFormName:n,actionFormName:d})}),!p&&(0,e.jsx)(mo,{disabled:!o,onClick:P})]})},Kn={napActionsHeader:"l_1I3njjXw8ADCVoW_tA"},Yn=[L.ENapoleonCatActions.INBOX_ACTION_ARCHIVE,L.ENapoleonCatActions.INBOX_ACTION_FLAG,L.ENapoleonCatActions.INBOX_ACTION_MULTITAG,L.ENapoleonCatActions.INBOX_ACTION_ASSIGN,L.ENapoleonCatActions.INBOX_ACTION_MARK],kn=({isBoxAvailable:o,triggerFormName:n})=>{const s=`${n}.${E.u$.NapoleonActionBoxEnabled}`,a=`${n}.${E.u$.SocialActionBoxEnabled}`,i=`${n}.${E.u$.NapoleonAction}`,d=`${n}.${E.u$.SocialAction}`,{formState:{submitCount:r},setValue:m,control:l}=(0,T.xW)(),u=(0,T.FH)({control:l,name:s}),h=(0,T.FH)({control:l,name:a}),p=(0,T.FH)({control:l,name:d}),A=(0,T.FH)({control:l,name:i}),x=(0,t.useTranslationCategory)(t.ETranslationCategories.autoModeration),v=x.AM_BOX_NAP_ACTIONS_HEADER,S=x.AM_BOX_NAP_ACTIONS_DESCRIPTION,N=!!r&&(j()(p)&&j()(A)||!u&&!h);(0,g.useEffect)(()=>{o||m(s,!1)},[o]);const O=()=>m(s,!0);return(0,e.jsxs)(Ge,{isEnabled:u,isInvalid:N,children:[(0,e.jsx)(Rt,{isToggleEnabled:o,headerText:v,headerDescription:S,className:Kn.napActionsHeader,toggleFormName:s}),u&&(0,e.jsx)(Yt,{actionsFlowConfig:null,availableActions:Yn,triggerFormName:n,actionFormName:i}),!u&&(0,e.jsx)(mo,{disabled:!o,onClick:O})]})};var Io=c(2302),vo=c(66508);const Zn={},Jn=({weekDays:o,startDate:n,endDate:s,onClick:a,dateRangeEnabled:i,hoursRangeEnabled:d,hasNoEndDate:r})=>{const m=(0,t.useTranslationCategory)(t.ETranslationCategories.autoModeration),l=u=>{const h={year:"numeric",month:"short",day:"numeric"};return u?u.toLocaleDateString("default",h):""};return(0,e.jsxs)("div",{className:Zn.boxScheduleSummary,children:[i&&(s||n)&&(0,e.jsx)(Te,{titleText:m.AM_BOX_SCHEDULE_SUMMARY_DATE_TITLE,onClick:a,children:(0,e.jsxs)(Q,{valueType:Y.Tag,children:[n&&l(n),!r&&s&&(0,e.jsxs)(e.Fragment,{children:[" - ",l(s)]})]})}),d&&o&&!!o.length&&(0,e.jsxs)(Te,{titleText:m.AM_BOX_SCHEDULE_SUMMARY_RULE_SCHEDULE_TITLE,onClick:a,children:[(0,e.jsx)(Q,{valueType:Y.Tag,children:o[0]}),o.length>1&&(0,e.jsx)(Q,{valueType:Y.Tag,children:`+ ${o.length-1}`})]})]})},je={content:"l5KDmEbgAyZxRIVVxgDV",section:"JpR86oIUol8AHSTI_UyC",title:"BpnYP_X59ZQEBcZr0FDV",dateRange:"oIZkcW1zcbcdvUdeH_Gu",hourScheduleWrapper:"YTOijAhDJW1ep5ookZDo",infinityIconContainer:"zCgUeyU4i75yS4eKtAqk",infinityIcon:"mUf0R_aqGlC6ov9OCucp"},Qn=()=>{const{getValues:n,control:s}=(0,T.xW)(),a=(0,T.FH)({control:s,name:E.U5.ScheduleBoxEnabled}),i=(0,T.FH)({control:s,name:E.U5.ScheduleStartDate}),d=(0,T.FH)({control:s,name:E.U5.ScheduleEndDate}),r=(0,T.FH)({control:s,name:E.U5.Schedule}),m=(0,T.FH)({control:s,name:E.U5.ScheduleDatesEnabled}),l=(0,T.FH)({control:s,name:E.U5.ScheduleHoursEnabled}),u=(0,T.FH)({control:s,name:E.U5.ScheduleHasNoEndDate}),[h,p]=(0,g.useState)(!0),A=(0,t.useTranslationCategory)(t.ETranslationCategories.autoModeration),x=(0,t.useTranslationCategory)(t.ETranslationCategories.main),v=A.AM_BOX_SCHEDULE_HEADER,S=A.AM_BOX_SCHEDULE_DESCRIPTION,N=A.AM_BOX_SCHEDULE_DATE_SCHEDULE_HEADING,O=A.AM_BOX_SCHEDULE_USE_RULE_ACCORDING_TO_DATE,R=A.AM_BOX_SCHEDULE_RULE_NO_END_DATE,I=A.AM_BOX_SCHEDULE_RULE_SCHEDULE_HEADING,_=A.AM_BOX_SCHEDULE_RULE_USE_ON_DEFINED_TIME,P=()=>p(!1),f=()=>p(!0),W=()=>{const z=[],B=n(E.U5.Schedule);return B?(Object.keys(B).forEach(re=>{var _e;const Ce=parseInt(re);B[Ce].length&&z.push(x[(_e=vo.sE[Ce])==null?void 0:_e.translationKey])}),z):[]},X=y().useMemo(()=>{const z=i?new Date(i.getTime()):new Date;return z.setMonth(z.getMonth()+1),z},[i]),le=y().useMemo(()=>new Date,[]),he=y().useMemo(()=>{if(i){const z=new Date(i.getTime());return z.setDate(z.getDate()+1),z}return null},[i]),V=r&&Object.keys(r).some(z=>!!r[z].length),ne=m||l&&V;return(0,e.jsxs)(Ge,{isEnabled:a,isInvalid:!1,className:je.wrapperBox,children:[(0,e.jsx)(Lt,{headerText:v,headerDescription:S,icon:t.EIconNames.BoxCalendar,toggleFormName:E.U5.ScheduleBoxEnabled}),a&&h&&(0,e.jsxs)("div",{className:je.content,children:[(0,e.jsxs)("div",{className:je.section,children:[(0,e.jsx)("div",{className:je.title,children:N}),(0,e.jsx)(It.c,{name:E.U5.ScheduleDatesEnabled,label:O,control:s}),m&&(0,e.jsx)(It.c,{name:E.U5.ScheduleHasNoEndDate,label:R,control:s}),m&&(0,e.jsxs)("div",{className:je.dateRange,children:[(0,e.jsx)(Io.j,{name:E.U5.ScheduleStartDate,defaultValue:le,minDate:le}),u?(0,e.jsxs)("div",{className:je.infinityIconContainer,children:[(0,e.jsx)(t.Icon,{name:t.EIconNames.ArrowRight,size:t.EIconSizes.size24}),(0,e.jsx)(t.Icon,{name:t.EIconNames.Infinity,size:t.EIconSizes.size24,classNames:je.infinityIcon})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Icon,{name:t.EIconNames.ArrowRight,size:t.EIconSizes.size24}
1),(0,e.jsx)(Io.j,{name:E.U5.ScheduleEndDate,defaultValue:X,minDate:he})]})]})]}),(0,e.jsxs)("div",{className:je.section,children:[(0,e.jsx)("div",{className:je.title,children:I}),(0,e.jsx)(It.c,{name:E.U5.ScheduleHoursEnabled,label:_,control:s}),l&&(0,e.jsx)("div",{className:je.hourScheduleWrapper,children:(0,e.jsx)(vo.Zj,{name:E.U5.Schedule})})]}),(0,e.jsx)(se,{onClick:P,disabled:!ne})]}),a&&!h&&(0,e.jsx)(Jn,{weekDays:W(),startDate:i,endDate:d,onClick:f,hoursRangeEnabled:l,dateRangeEnabled:m,hasNoEndDate:u})]})},Nt={boxStopAutomoderation:"N1TDVsAzXNUhd8cytA4P",headerTitle:"w1BULcXUSj2ddtxeaaq4",header:"wOVn_Cd9t4ZwFGnAHMiE",wrapperBox:"m8y52aITCgZ5jsweLESA"},qn=()=>{const{control:o}=(0,T.xW)(),n=(0,T.FH)({control:o,name:E.U5.isFinalRule}),s=(0,t.useTranslationCategory)(t.ETranslationCategories.autoModeration),a=s.AM_BOX_STOP_AUTOMODERATION_DESCRIPTION,i=s.AM_BOX_STOP_AUTOMODERATION_TOOLTIP;return(0,e.jsx)("div",{className:H()(Nt.boxStopAutomoderation),children:(0,e.jsx)(Ge,{className:Nt.wrapperBox,isEnabled:n,children:(0,e.jsx)(Rt,{isToggleEnabled:!0,headerText:a,headerDescription:i,className:Nt.header,classHeaderText:Nt.headerTitle,hintColor:t.EIconColors.Grey,toggleFormName:E.U5.isFinalRule})})})};var es=c(87035);const ts={boxNotificationSummary:"ImJqOeIGiYQlbmZDLU8r"},os=({emails:o,emailContent:n,onClick:s})=>{const a=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_BOX_NOTIFICATION_SUMMARY_EMAILS_TITLE"),i=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_BOX_NOTIFICATION_SUMMARY_EMAIL_CONTENT_TITLE");return(0,e.jsxs)("div",{className:ts.boxNotificationSummary,children:[o&&o.length&&(0,e.jsxs)(Te,{onClick:s,titleText:a,children:[(0,e.jsx)(Q,{valueType:Y.Tag,children:o[0]}),o.length>1&&(0,e.jsx)(Q,{valueType:Y.Tag,children:`+ ${o.length-1}`})]}),n&&(0,e.jsx)(Te,{onClick:s,titleText:i,children:(0,e.jsx)(Q,{valueType:Y.Tag,children:n})})]})},ot={content:"DET54BPqW7Ugl0N1zF3z",inputWrapper:"PAG9FMrOY0tBAECAohU5",legend:"IpUecevXt5n9Bo0cimuw",textarea:"coLbQJ_dLjTwMwRnNV32",continue:"K98c9ST2Tq7QXswqjl1o"},ns=({triggerFormName:o})=>{const{control:n,setValue:s,getFieldState:a,formState:i}=(0,T.xW)(),{submitCount:d}=i,r=`${o}.${E.u$.NotificationBoxEnabled}`,m=`${o}.${E.u$.NotifyEmails}`,l=`${o}.${E.u$.NotifyContent}`,u=(0,T.FH)({control:n,name:r}),h=(0,T.FH)({control:n,name:m}),p=(0,T.FH)({control:n,name:l}),[A,x]=(0,g.useState)(!0),v=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_BOX_NOTIFICATION_EMAIL_CONTENT_PLACEHOLDER"),S=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_BOX_NOTIFICATION_HEADER"),N=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_BOX_NOTIFICATION_DESCRIPTION"),O=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_BOX_NOTIFICATION_EMAILS_TITLE"),R=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_BOX_NOTIFICATION_EMAILS_PLACEHOLDER"),I=(0,t.useTranslation)(t.ETranslationCategories.autoModeration,"AM_BOX_NOTIFICATION_EMAIL_CONTENT_TITLE"),_=()=>x(!A),P=()=>{x(!1)};(0,g.useEffect)(()=>{u&&(!p||!p.length)&&s(l,v)},[u]);const f=u&&(a(m).error||a(l).error)&&!!d;return(0,e.jsxs)(Ge,{isEnabled:u,isInvalid:f,children:[(0,e.jsx)(Lt,{headerText:S,headerDescription:N,icon:t.EIconNames.BoxBell,toggleFormName:r}),u&&A&&(0,e.jsxs)("div",{className:ot.content,children:[(0,e.jsxs)("div",{className:ot.inputWrapper,children:[(0,e.jsx)("p",{children:O}),(0,e.jsx)(es.S,{required:!0,placeholder:R,name:m})]}),(0,e.jsxs)("div",{className:ot.inputWrapper,children:[(0,e.jsx)("p",{children:I}),(0,e.jsx)(t.TextAreaWithForm,{name:l,value:p,classNames:ot.textarea,resizableVertical:!0})]}),(0,e.jsx)("div",{className:ot.legend,children:(0,e.jsx)(t.TranslatedMessage,{withHTML:!0,translationKey:"AM_BOX_NOTIFICATION_EMAIL_CONTENT_LEGEND",category:t.ETranslationCategories.autoModeration})}),(0,e.jsx)("div",{className:ot.continue,children:(0,e.jsx)(se,{onClick:P,disabled:!h?.length})})]}),u&&!A&&(0,e.jsx)(os,{onClick:_,emails:h,emailContent:p})]})}},44999:(Ze,pe,c)=>{c.d(pe,{J:()=>be});var e=c(65723),g=c(81924),y=c.n(g),t=c(60585),M=c(85067),Ae=c(73417),j=c(12046),G=c.n(j),T=c(96181),E=c(70583),Le=c(67918),L=c(62598),k=c(87531),te=c(13744),ue=c(94511),K=c(25138);const H={triggerBranch:"OnPzqFvdbnocdes29hb0",removeButton:"ytTeLGHEN7oVV6n64Hy1"},oe=({name:$,index:D,removable:J,onRemove:De,control:Se})=>{const{data:ye}
1=(0,k.Qy)(void 0),we=(0,L.useSelector)(te.IZ),ie=(0,t.FH)({control:Se,name:T.U5.Platform}),Ue=(0,t.FH)({control:Se,name:T.U5.AttachedToProfiles}),xe=(0,t.FH)({control:Se,name:T.U5.Condition}),We=!G()(ie)&&!(0,Le.isEmpty)(Ue)||!!we,at=y().useMemo(()=>{if(ie&&ye&&xe){const He=ye[ie],Ne=He.conditions[xe];return Ne?He.socialMediaActions[Ne].filter(it=>{var me;return!((me=ue.k[xe])!=null&&me.includes(it))}):[]}return[]},[xe,ie,ye]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(K.LC,{children:[(0,e.jsx)(K.IM,{name:$,withToggle:D===0,isRequired:D>0}),J&&!!De&&(0,e.jsx)(M.Button,{theme:M.EButtonThemes.Transparent,onClick:De,classNames:H.removeButton,children:(0,e.jsx)(M.Icon,{name:M.EIconNames.RemoveWithBg,size:M.EIconSizes.size24})})]}),(0,e.jsx)(K.LC,{children:(0,e.jsx)(K.cr,{triggerFormName:$,isBoxAvailable:We,availableActions:at})}),(0,e.jsx)(K.LC,{children:(0,e.jsx)(K.C0,{triggerFormName:$,isBoxAvailable:We})}),(0,e.jsx)("div",{children:(0,e.jsx)(K.tq,{triggerFormName:$})})]})},w={triggerBranches:"vwgFCzvZJcr6f7EthGSq",addButton:"o2Caj2Fv73niY7weeaks",icon:"E5sgvMWaEu7E0W7x_UZA",tooltip:"hIi30mHROa7Wt2j9Yaoy",tooltipTitle:"zKMj7RStEwAKQsYWRZpg",tooltipSubtitle:"pZWuGsuriBPF_AxDLOxF",tooltipContainer:"n5ra5jUwlFXKKCpFwdyu"};var U=Object.defineProperty,de=Object.defineProperties,ve=Object.getOwnPropertyDescriptors,se=Object.getOwnPropertySymbols,Ie=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable,Z=($,D,J)=>D in $?U($,D,{enumerable:!0,configurable:!0,writable:!0,value:J}):$[D]=J,ae=($,D)=>{for(var J in D||(D={}))Ie.call(D,J)&&Z($,J,D[J]);if(se)for(var J of se(D))ge.call(D,J)&&Z($,J,D[J]);return $},fe=($,D)=>de($,ve(D));const be=({control:$,onAddBranch:D})=>{const J=(0,g.useRef)(null),[De,Se]=(0,g.useState)(!1),ye=(0,M.useTranslation)(M.ETranslationCategories.autoModeration,"AM_BOX_TRIGGER_BRANCHES_TOOLTIP_TITLE"),we=(0,M.useTranslation)(M.ETranslationCategories.autoModeration,"AM_BOX_TRIGGER_BRANCHES_TOOLTIP_SUBTITLE"),ie=6,Ue=T.U5.Triggers,{fields:xe,append:We,remove:at}=(0,t.jz)({control:$,name:Ue}),He=()=>{We(fe(ae({},T.Ob),{[T.u$.TriggerBoxEnabled]:!0}),{shouldFocus:!1}),D&&D()},Ne=Ee=>{at(Ee)},it=Ee=>{const Pe=Ee[T.u$.SocialAction],rt=!!Pe&&!G()(Pe),Et=Ee[T.u$.SocialActionBoxEnabled],Tt=Ee[T.u$.NapoleonAction],Ot=!!Tt&&!G()(Tt),ht=Ee[T.u$.NapoleonActionBoxEnabled],pt=Ee[T.u$.NotifyEmails],jt=!!pt&&!G()(pt),gt=Ee[T.u$.NotifyContent],_t=!!gt&&!G()(gt);return rt&&Et||Ot&&ht||jt&&_t},me=Ee=>it(Ee)?!0:"NO_ACTION";return(0,e.jsxs)("div",{className:w.triggerBranches,children:[xe.map((Ee,Pe)=>(0,e.jsx)(t.xI,{control:$,rules:{validate:rt=>me(rt)},name:`${Ue}.${Pe}`,render:()=>(0,e.jsx)(oe,{control:$,index:Pe,removable:xe.length>1,name:`${Ue}.${Pe}`,onRemove:()=>Ne(Pe)})},Ee.id)),xe.length<ie&&(0,e.jsxs)("div",{ref:J,className:w.tooltipContainer,onMouseEnter:()=>{Se(!0)},onMouseLeave:()=>{Se(!1)},children:[(0,e.jsx)(Ae.XF,{children:De&&(0,e.jsxs)(E.A,{triggerRef:J,onHide:()=>Se(!1),placement:M.EFloatingUIPlacements.Top,classNames:w.tooltip,children:[(0,e.jsx)("div",{className:w.tooltipTitle,children:ye}),(0,e.jsx)("div",{className:w.tooltipSubtitle,children:we})]})}),(0,e.jsx)(M.Button,{onClick:He,theme:M.EButtonThemes.Transparent,size:M.EButtonSizes.Medium,classNames:w.addButton,children:(0,e.jsx)(M.Icon,{name:M.EIconNames.PlusWithBg,size:M.EIconSizes.size24,classNames:w.icon})})]})]})}},50641:(Ze,pe,c)=>{c.d(pe,{X:()=>H});var e=c(65723),g=c(81924),y=c(62934),t=c(60585),M=c(62598),Ae=c(85067),j=c(12684),G=c(36018),T=c(96181),E=c(13744),Le=c(79854),L=c(66525);const k={editorHeader:"HbSdpAEGySfyMUw1CphP",editorHeaderColumn:"MxjjzVwW0zmjrVjmY0ZE",descriptionAnchor:"S28uD3eMl1_VYiC26EU3",formButtons:"hg8kanpFt9JhQqAscVfE",nameInputWrapper:"idid0FvDkFjGHJm9nd0w",backButton:"tTWmJHD8KfX5cSfLNMwP",arrowAndNameContainer:"q5oHs9HlD38oiXQHLBMV"};var te=c(4401),ue=(oe,w,U)=>new Promise((de,ve)=>{var se=Z=>{try{ge(U.next(Z))}catch(ae){ve(ae)}},Ie=Z=>{try{ge(U.throw(Z))}catch(ae){ve(ae)}},ge=Z=>Z.done?de(Z.value):Promise.resolve(Z.value).then(se,Ie);ge((U=U.apply(oe,w)).next())});const K=oe=>{const w=oe;w.preventDefault(),w.returnValue=""},H=({onSubmit:oe,isSubmitting:w})=>{const U=(0,g.useRef)(null),de=(0,M.useDispatch)(),{setValue:ve,formState:se,control:Ie}=(0,t.xW)(),{isValid:ge,submitCount:Z,isDirty:ae}=se,fe=(0,y.W6)(),be="AM_RULE_EDITOR_FORM_VALIDATION_ERROR",$="AM_RULE_EDITOR_NOT_SAVED_WARNING",D=(0,M.useSelector)(E.UY),J=()=>{fe.push({pathname:(0,G.Q)(G.E.autoModeration.main)})},De=(0,g.useMemo)(()=>w?!1:!!Z&&ae&&!ge,[w,ae,ge,Z]),Se=()=>ue(void 0,null,function*(){yield oe()}),ye=()=>ue(void 0,null,function*(){ve(T.U5.IsEnabled,!0,{shouldValidate:!1}),yield oe()}),we=()=>{if(De)return be;if(D)return $};return(0,g.useEffect)(()=>(de((0,E.s7)(!1)),()=>{de((0,E.s7)(!1))}),[Z]),(0,g.useEffect)(()=>(ae||!ge?window.addEventListener("beforeunload",K):window.removeEventListener("beforeunload",K),()=>window.removeEventListener("beforeunload",K)),[ae]),(0,e.jsxs)("div",{className:k.editorHeader,children:[(0,e.jsx)("div",{className:k.editorHeaderColumn,children:(0,e.jsxs)("div",{className:k.arrowAndNameContainer,children:[(0,e.jsx)(j.BackArrow,{onClick:J,className:k.backButton}),(0,e.jsx)("div",{className:k.nameInputWrapper,children:(0,e.jsx)(Le.e,{control:Ie})})]})}),(0,e.jsx)("div",{children:(0,e.jsx)(te.n$,{className:k.formButtons,onCancelClick:J,onSaveClick:Se,onSaveAndRunClick:ye,warningTooltipTranslationKey:we(),disableSave:!ae})}),(0,e.jsx)("div",{className:k.descriptionAnchor,ref:U}),(0,e.jsx)(Ae.FloatingElement,{attachToRef:U,placement:Ae.EFloatingUIPlacements.Right,children:(0,e.jsx)(L.X,{control:Ie})})]})}},66525:(Ze,pe,c)=>{c.d(pe,{X:()=>E});var e=c(65723),g=c(81924),y=c(30395),t=c.n(y),M=c(85067),Ae=c(60585),j=c(9263);const G={ruleDescription:"jEN3AyAQ4AkWAq_yGMFR",textarea:"cnXJGFd5ITd3AnooCm8U",inputWrapper:"N8l9ZN0_qmvjB7IUIKYw",textAreaNotExpanded:"lX0KlzoPGpEwrbaOBGie",iconWrapper:"cw7GKycJR_q9I_30hJUk",charCounterWrapper:"_ldPPAkDOIWJXegEMoer"};var T=c(96181);const E=({control:Le})=>
1{const[k,te]=(0,g.useState)(!1),ue=T.U5.Description,K=(0,M.useTranslation)(M.ETranslationCategories.autoModeration,"AM_RULE_EDITOR_DESCRIPTION_INPUT_PLACEHOLDER"),H=(0,Ae.FH)({control:Le,name:ue}),oe=()=>te(!1),w=()=>te(!0);return(0,e.jsxs)("div",{className:G.ruleDescription,onBlur:oe,onFocus:w,children:[(0,e.jsxs)("div",{className:G.inputWrapper,children:[(0,e.jsx)("div",{className:G.iconWrapper,children:(0,e.jsx)(M.Icon,{name:M.EIconNames.Note,size:M.EIconSizes.size19})}),(0,e.jsx)(M.TextAreaWithForm,{maxLength:280,placeholder:K,name:ue,classNames:t()(G.textarea,{[G.textAreaNotExpanded]:!k}),resizable:!1,expandOnClick:!0,required:!1,rowsQuantity:1})]}),k&&(0,e.jsx)("div",{className:G.charCounterWrapper,children:(0,e.jsx)(j.X,{current:H.length,max:280})})]})}},79854:(Ze,pe,c)=>{c.d(pe,{e:()=>M});var e=c(65723),g=c(85067);const y={inputWrapper:"NmYPct2HusVxP7ZzYeHI",ruleNameInput:"rPN_OtfoxIVrxrlyqi3w"};var t=c(96181);const M=({control:Ae})=>{const j=(0,g.useTranslation)(g.ETranslationCategories.autoModeration,"AM_RULE_EDITOR_NAME_INPUT_PLACEHOLDER"),G=t.U5.Name;return(0,e.jsx)("div",{className:y.inputWrapper,children:(0,e.jsx)(g.TextInputWithForm,{blurOnEnter:!0,name:G,classNames:y.ruleNameInput,placeholder:j,required:!0,adjustSizeToPlaceholder:!0,control:Ae})})}},97540:(Ze,pe,c)=>{c.d(pe,{PJ:()=>e.P});var e=c(56056),g=c(4401)}}]);

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.